在matplotlib中设置y轴限制
我需要在matplotlib上设置y轴限制的帮助。这是我尝试失败的代码。 import matplotlib.pyplot as plt plt.figure(1, figsize = (8.5,11)) plt.suptitle('plot title') ax = [] aPlot = plt.subplot(321, axisbg = 'w', title = "Year 1") ax.append(aPlot) plt.plot(paramValues,plotDataPrice[0], color = '#340B8C', marker = 'o', ms = 5, mfc = '#EB1717') plt.xticks(paramValues) plt.ylabel('Average Price') plt.xlabel('Mark-up') plt.grid(True) plt.ylim((25,250)) 使用此图的数据,我得到的Y轴限制为20和200。但是,我希望限制为20和250。