python:matplotlib:目盛りの設定
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
python:matplotlib:目盛りの設定 [2018/01/24 21:27] – [目盛りの場所] koudai | python:matplotlib:目盛りの設定 [2021/06/27 22:04] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 26: | Line 26: | ||
{{: | {{: | ||
- | 上の例では数字を直接入力しましたが、np.arrangeとplt.xlim, | + | 上の例では目盛りの数字をすべて直接入力しましたが、np.arangeとplt.xlim, |
<file python> | <file python> | ||
Line 50: | Line 50: | ||
====== 目盛りの幅と長さ ====== | ====== 目盛りの幅と長さ ====== | ||
- | tick_paramで指定できます。 | + | 目盛りの幅と長さtick_paramsで指定できます。 |
- | 幅と長さはそれぞれwidthとlengthで指定します。 | + | それぞれwidthとlengthで指定します。 |
<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() | ||
</ | </ |
python/matplotlib/目盛りの設定.1516796867.txt.gz · Last modified: 2021/06/27 21:59 (external edit)