y軸の上限を 'auto'に設定したいが、下限を維持したいy軸は常にゼロになります。私は「オート」と「オートレンジ」を試みましたが、それらは機能していないようです。前もって感謝します。上限を 'auto'に設定する方法はmatplotlib.pyplotで固定下限を維持する方法
import matplotlib.pyplot as plt
def plot(results_plt,title,filename):
############################
# Plot results
# mirror result table such that each parameter forms an own data array
plt.cla()
#print results_plt
XY_results = []
XY_results = zip(*results_plt)
plt.plot(XY_results[0], XY_results[2], marker = ".")
plt.title('%s' % (title))
plt.xlabel('Input Voltage [V]')
plt.ylabel('Input Current [mA]')
plt.grid(True)
plt.xlim(3.0, 4.2) #***I want to keep these values fixed"
plt.ylim([0, 80]) #****CHANGE**** I want to change '80' to auto, but still keep 0 as the lower limit
plt.savefig(path+filename+'.png')
set_ylimの左側を通過したときにエラーが発生しました。 私はこれを代わりに使用しました:plt.gca()。set_ylim(ymin = 0) ありがとうございました。 – vietnastee
'plt.xlim'または' plt.ylim'を使って、現在の軸の制限を設定することもできます。 – Chris
これを行うと、ウィンドウがインスタンス化するどんな値にも上限が付きます。自動スケーリングのままではありません。 – Elliot