What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-20 09:17:57
central limit theorem python example
import numpy as npimport matplotlib.pyplot as pltdef repeat_sample_draws_exponential(n, samp_size, mu, show_all=False): means = [] samples = [] for ii in range(0, n): samples.append(np.random.exponential(mu, samp_size)) means.append... Add solution -
Python 2021-11-20 00:32:16
plt subplots figsize
f, axs = plt.subplots(2,2,figsize=(15,15)) Add solution -
Python 2021-11-16 11:06:19
how to set axis range matplotlib
# For a given y=time-dependent variable, x=time fig, ax = plt.subplots(figsize=(12, 6)) ax.plot(y, label='y') #'lower' is lower limit of the range you wanna set #'upper' is upper limit of the range you wanna set plt.xlim(lower, upper) Add solution -
Python 2021-11-15 14:14:28
this figure includes axes that are not compatible with tight_layout, so results might be incorrect
fig, ax = plt.subplots() fig.set_tight_layout(False) X = np.linspace(-np.pi, np.pi, 256,endpoint=True) C,S = np.cos(X), np.sin(X) ax.plot(X,C) ax.plot(X,S) plt.show() Add solution -
Other 2021-11-15 09:11:18
visualizing logistic regression separator plane
f, ax = plt.subplots(figsize=(8, 6)) ax.contour(xx, yy, probs, levels=[.5], cmap="Greys", vmin=0, vmax=.6) ax.scatter(X[100:,0], X[100:, 1], c=y[100:], s=50, cmap="RdBu", vmin=-.2, vmax=1.2, edgecolor="white... Add solution