๋ฐ์ํ
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
https://matplotlib.org/api/_as_gen/matplotlib.pyplot.hlines.html#matplotlib.pyplot.hlines
๋ฐ์ํ
'Python > Matplotlib' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Python] matplotlib - plot outside text (0) | 2020.10.13 |
---|---|
[Python] matplotlib - plot ์ด๋ฏธ์ง ์ ์ฅ (0) | 2020.08.25 |
[Python] matplotlib - axvspan, hatch ๋ฉด์ , ํจํด ๊ทธ๋ฆฌ๊ธฐ (0) | 2020.02.26 |
[Python] matplotlib - plot ํฐํธ ํฌ๊ธฐ ๋ณ๊ฒฝ (0) | 2019.07.29 |