What do you want to save?
Add Code snippet
New code examples
-
C 2021-08-28 10:37:02
plt circle
import matplotlib.pyplot as plt circle1 = plt.Circle((0, 0), 0.2, color='r') circle2 = plt.Circle((0.5, 0.5), 0.2, color='blue') circle3 = plt.Circle((1, 1), 0.2, color='g', clip_on=False) fig, ax = plt.subplots() # note we must use plt.subplots, not pl... Add solution -
-
Python 2021-08-27 15:24:02
python matplotlib two y axis
import numpy as np import matplotlib.pyplot as plt # Create some mock data t = np.arange(0.01, 10.0, 0.01) data1 = np.exp(t) data2 = np.sin(2 * np.pi * t) fig, ax1 = plt.subplots() color = 'tab:red' ax1.set_xlabel('time (s)') ax1.set_ylabel('exp', colo... Add solution -
Python 2021-08-27 14:03:01
plot normal distribution python
import matplotlib.pyplot as plt import numpy as np import scipy.stats as stats import math mu = 0 variance = 1 sigma = math.sqrt(variance) x = np.linspace(mu - 3 * sigma, mu + 3 * sigma, 100) plt.plot(x, stats.norm.pdf(x, mu, sigma)) plt.show() Add solution -
Python 2021-08-27 10:11:02
set title matplotlib
import matplotlib.pyplot as plt plt.title('TITLE') Add solution