デフォルトでは、x軸はグラフの下に、y軸は左側につけられる。
例
import numpy as np
from matplotlib import pyplot as plt
x = np.linspace(-10,10,100)
y = np.sin(x)
fig, ax = plt.subplots()
ax.scatter(x,y, s=100, alpha=0.3,label="sin")
ax.xaxis.set_ticks_position('top')
ax.yaxis.set_ticks_position('right')
plt.show()
結果
