相关疑难解决方法(0)

在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))
Run Code Online (Sandbox Code Playgroud)

根据我对该图的数据,我得到20和200的y轴限制.但是,我想要限制20和250.

python matplotlib

366
推荐指数
8
解决办法
79万
查看次数

标签 统计

matplotlib ×1

python ×1