[Python] matplotlib - plot outside text
plot ๋ฐ๊นฅ์ชฝ์ text ์ฐ๊ธฐ plt.text(1.03, 0.95, textstr, transform=ax.transAxes, fontsize=14, verticalalignment='top', bbox=props) import numpy as np import matplotlib.pyplot as plt np.random.seed(19680801) fig, ax = plt.subplots() x = 30*np.random.randn(10000) mu = x.mean() median = np.median(x) sigma = x.std() textstr = '\n'.join(( r'$\mu=%.2f$' % (mu, ), r'$\mathrm{median}=%.2f$' % (median, ), r'$\sig..
[Python] matplotlib - plot ์์ง์ , ์ํ์ ๊ทธ๋ฆฌ๊ธฐ
import matplotlib.pyplot as plt plt.plot([1,2,3,4,5],[1,2,3,4,5]) # vertical lines, x=2, y = 1~4 plt.vlines(2, 1, 4) # horizontal lines, y=2, x=1~5 plt.hlines(2, 1, 5, 'y') plt.show() https://matplotlib.org/api/_as_gen/matplotlib.pyplot.vlines.html matplotlib.pyplot.vlines — Matplotlib 3.3.1 documentation Plot vertical lines. Plot vertical lines at each x from ymin to ymax. Note In addition to t..
[Python] matplotlib - axvspan, hatch ๋ฉด์ , ํจํด ๊ทธ๋ฆฌ๊ธฐ
import numpy as np import matplotlib.pyplot as plt t = np.arange(-1, 3, .01) s = np.sin(2.5 * np.pi * t) plt.plot(t, s) plt.axvspan(1.25, 1.55, facecolor='red', edgecolor='gold', alpha=0.5, hatch='///') plt.show() https://matplotlib.org/3.1.3/api/_as_gen/matplotlib.pyplot.axvspan.html matplotlib.pyplot.axvspan — Matplotlib 3.1.3 documentation Parameters: xmin : scalar Number indicating the first..