fig = plt.figure() ax = fig.add_axes([left, bottom, width, height]) # 0.0~1.0 ax.plot(x, y) # 現在の表示範囲を取得 xmin, xmax, ymin, ymax = ax.axis() # xlocs: x軸目盛位置, xlabels: x軸ラベル xlocs = ax.get_xticks() xlabels = ax.get_xticklabels() ylocs = ax.get_yticks() ylabels = ax.get_yticklabels() # 軸の範囲を指定する ax.set_xlim(xmin, xmax) # set only x-axis ax.axis([xmin, xmax, ymin, ymax]) # set x-axis and y-axis at once