What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-13 16:05:11
connect a mean value to histogram pandas
import numpy as np import matplotlib.pyplot as plt np.random.seed(6789) x = np.random.gamma(4, 0.5, 1000) result = plt.hist(x, bins=20, color='c', edgecolor='k', alpha=0.65) plt.axvline(x.mean(), color='k', linestyle='dashed', linewidth=1) min_ylim, max_... 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-16 22:08:08
matplotlib point labels
import matplotlib.pyplot as plt import numpy as np plt.clf() # using some dummy data for this example xs = np.arange(0,10,1) ys = np.random.normal(loc=2.0, scale=0.8, size=10) plt.plot(xs,ys) # text is left-aligned plt.text(2,4,'This text starts at po... Add solution