What do you want to save?
Add Code snippet
New code examples
-
-
Python 2022-02-16 01:10:02
matplotlib plot two graphs side by side
import matplotlib.pyplot as plt import numpy as np # Simple data to display x = np.linspace(0, 2 * np.pi, 400) y = np.sin(x ** 2) # the container holding the two Axes have already been unpacked # useful if just few Axes have been created f, (ax1, ax2) ... Add solution -
Python 2022-02-15 20:00:08
how to plot side by side bar horizontal bar graph in python
import pandas import matplotlib.pyplot as plt import numpy as np df = pandas.DataFrame(dict(graph=['Item one', 'Item two', 'Item three'], n=[3, 5, 2], m=[6, 1, 3])) ind = np.arange(len(df)) width = 0.4 fig, ax = plt.subplots... Add solution -
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 2022-02-11 10:25:01
quadratic equation plot in python
import matplotlib.pyplot as plt import numpy as np # 100 linearly spaced numbers x = np.linspace(0,1,10) eta1=0.05 eta2=0.1 lmd1= 2.8 # the function, which is y = x^2 here y = 0.5*(-(1/3)*eta1*x**2 + np.sqrt( ((1/3)*eta1*x**2)**2-4*(3*x**2*2.8**2-1)) #... Add solution -
Python 2022-02-10 07:35:02
python scatterplot figsize
plt.figure(figsize=(8, 8)) plt.scatter(x, y) Add solution -