X軸の範囲指定には pyplot.xlim()
、Y軸の範囲指定には pyplot.ylim()
をご使用ください。
Python
1import matplotlib.pyplot as plt
2
3plt.scatter([0,1,0,1],[0,0,1,1])
4plt.xlim(0,1)
5plt.ylim(0,1)
6plt.show()
Axesコンテナを使用している場合は同様に Axes.set_xlim()
と Axes.set_ylim()
が使えます。
import matplotlib.pyplot as plt
ax = plt.subplot()
ax.scatter([0,1,0,1],[0,0,1,1])
ax.set_xlim(0,1)
ax.set_ylim(0,1)
plt.show()
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/06/15 01:55