๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ


Python/Matplotlib

(5)
[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 - plot ์ด๋ฏธ์ง€ ์ €์žฅ import matplotlib.pyplot as plt plt.(x, y) plt.savefig('figure.png', dpi=80)
[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..
[Python] matplotlib - plot ํฐํŠธ ํฌ๊ธฐ ๋ณ€๊ฒฝ import matplotlib.pyplot as plt SMALL_SIZE = 8 MEDIUM_SIZE = 10 BIGGER_SIZE = 12 plt.rc('font', size=SMALL_SIZE) # controls default text sizes plt.rc('axes', titlesize=SMALL_SIZE) # fontsize of the axes title plt.rc('axes', labelsize=MEDIUM_SIZE) # fontsize of the x and y labels plt.rc('xtick', labelsize=SMALL_SIZE) # fontsize of the tick labels plt.rc('ytick', labelsize=SMALL_SIZE) # fontsize o..