我有一个在matplotlib(时间序列数据)中创建的图形,其中有一系列
matplotlib.pyplot.axvline
Run Code Online (Sandbox Code Playgroud)
线.我想在图上创建标签,这些标签看起来接近(可能在线的RHS和图的顶部)这些垂直线.
我正在使用matplotlib.pyplot从Dataframe绘制图形。在这里,我想显示每个矩形上条形的高度,并且正在使用Text()。为了标准化Y轴,我在Y轴上采用了Logscale。以下是我的代码,出现错误
Image size of 1005x132589 pixels is too large. It must be less than 2^16 in each direction
Run Code Online (Sandbox Code Playgroud)
当我不使用时,plt.yscale('log')代码工作正常。根据一些建议,我也重新启动了内核,但仍然遇到此问题。欢迎对此提出任何建议。
我的代码:
`
#收集到的数据列出。list_alarms = df_region.alarmName#list_east = df_region.EAST list_west = df_region.WEST list_north = df_region.NORTH list_south = df_region.SOUTH
# X-ticks customization
N = len(list_alarms)
xpos = np.arange(N)
# this json file is used to update the style of the plot.
s = json.load(open('style.json'))
rcParams.update(s)
# Graph customize
plt.rcParams['figure.figsize'] = (15,8)
plt.xlabel('AlarmNames at different Regions')
plt.ylabel('Frequency for alarms in MNG-PAN devices')
plt.title('Alarm …Run Code Online (Sandbox Code Playgroud)