plot
Bokeh: save plot (as HTML) but don’t show it
Solution is to replace calls to show by calls to save.
Is there a clean way to generate a line histogram chart?
Using scipy, you could use stats.gaussian_kde to estimate the probability density function: import matplotlib.pyplot as plt import numpy as np import scipy.stats as stats noise = np.random.normal(0, 1, (1000, )) density = stats.gaussian_kde(noise) n, x, _ = plt.hist(noise, bins=np.linspace(-3, 3, 50), histtype=u’step’, density=True) plt.plot(x, density(x)) plt.show()
How to change the figure size of Dataframe.hist for pandas 0.11.0
Let’s try something like this: fig = plt.figure(figsize = (15,20)) ax = fig.gca() df.hist(ax = ax)
How to make xticks evenly spaced despite their value?
You can do it by plotting your variable as a function of the “natural” variable that parametrizes your curve. For example: n = 12 a = np.arange(n) x = 2**a y = np.random.rand(n) fig = plt.figure(1, figsize=(7,7)) ax1 = fig.add_subplot(211) ax2 = fig.add_subplot(212) ax1.plot(x,y) ax1.xaxis.set_ticks(x) ax2.plot(a, y) #we plot y as a function of a, … Read more