What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-20 14:20:10
python convert ylabel to currency
import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker # Fixing random state for reproducibility np.random.seed(19680801) fig, ax = plt.subplots() ax.plot(100*np.random.rand(20)) formatter = ticker.FormatStrFormatter('$%1... Add solution -
Other 2021-10-20 08:32:13
sklearn random forest feature importance
import pandas as pd forest_importances = pd.Series(importances, index=feature_names) fig, ax = plt.subplots() forest_importances.plot.bar(yerr=std, ax=ax) ax.set_title("Feature importances using MDI") ax.set_ylabel("Mean decrease in impuri... Add solution -
Python 2021-10-19 12:50:14
seaborn create horizontal bar graph
import seaborn as sns import matplotlib.pyplot as plt sns.set_theme(style="whitegrid") # Initialize the matplotlib figure f, ax = plt.subplots(figsize=(6, 15)) # Load the example car crash dataset crashes = sns.load_dataset("car_crashes&q... Add solution -
Other 2021-10-19 01:02:05
ml for price forecasting rstudio
# Make Sessionnet = tf.Session()# Run initializernet.run(tf.global_variables_initializer())# Setup interactive plotplt.ion()fig = plt.figure()ax1 = fig.add_subplot(111)line1, = ax1.plot(y_test)line2, = ax1.plot(y_test*0.5)plt.show()# Number of epochs and ... Add solution -
Other 2021-10-18 18:40:12
matplotlib pie chart label order
import matplotlib.pyplot as plt import pandas as pd #corresponding color-label pairs colors = ['#99f3bd', '#fbaccc', '#a8df65', '#ff7b54'] labels = ["Yes", "Sometimes", "Most of the times", "No"] #... Add solution -
Python 2021-10-18 02:11:03
python matplotlib how to graph point on line
import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.set_xlim(0,10) ax.set_ylim(0,10) # draw lines xmin = 1 xmax = 9 y = 5 height = 1 plt.hlines(y, xmin, xmax) plt.vlines(xmin, y - height / 2., y + height / 2.) plt.vlines(xmax,... Add solution -
Python 2021-10-18 00:11:04
matplotlib bar3d
import numpy as np import matplotlib.pyplot as plt # setup the figure and axes fig = plt.figure(figsize=(8, 3)) ax1 = fig.add_subplot(121, projection='3d') ax2 = fig.add_subplot(122, projection='3d') # fake data _x = np.arange(4) _y = np.arange(5) _xx,... Add solution -
Python 2021-10-17 13:54:07
matplotlib get padding from bbox
import matplotlib matplotlib.rc('text',usetex=True) import matplotlib.pyplot as plt from matplotlib.patches import Rectangle import numpy as np text = '\\begin{tabular}{|c|c|}\\hline1&2\\\\\\hline3&4\\\\\\hline\\end{tabular}' fig, ax = plt.subpl... Add solution
Best helpers
Rlw
+5
John Rualo
+5
Michael Wang
+5
Heavens
+5
Calvino
+5
Withparadox2
+5
SuzyTypehead
+5
Aj Morales
+5