This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
python:matplotlib:目盛りの設定 [2018/01/24 21:29] koudai [目盛りの幅と長さ] |
python:matplotlib:目盛りの設定 [2021/06/27 22:04] (current) |
||
---|---|---|---|
Line 26: | Line 26: | ||
{{: | {{: | ||
- | 上の例では数字を直接入力しましたが、np.arrangeとplt.xlim, | + | 上の例では目盛りの数字をすべて直接入力しましたが、np.arangeとplt.xlim, |
<file python> | <file python> | ||
Line 61: | Line 61: | ||
plt.plot(x, y) | plt.plot(x, y) | ||
- | |||
- | plt.xticks([-6, | ||
- | plt.yticks([-1.5, | ||
- | |||
- | plt.xticks(np.arange(-6, | ||
- | plt.yticks(np.arange(-1.5, | ||
- | |||
- | plt.xlim(-5, | ||
- | plt.ylim(-1.2, | ||
plt.tick_params(width = 2, length = 10) | plt.tick_params(width = 2, length = 10) | ||
Line 95: | Line 86: | ||
plt.plot(x, y) | plt.plot(x, y) | ||
- | |||
- | plt.xticks([-6, | ||
- | plt.yticks([-1.5, | ||
- | |||
- | plt.xticks(np.arange(-6, | ||
- | plt.yticks(np.arange(-1.5, | ||
- | |||
- | plt.xlim(-5, | ||
- | plt.ylim(-1.2, | ||
plt.show() | plt.show() | ||
</ | </ |