【发布时间】:2017-07-10 14:02:34
【问题描述】:
我已经使用 matplotlib 制作了一个误差线图,但是它太拥挤了,无法在没有放大的情况下看到所有内容。我当然可以这样做,但是当我保存绘图时,我只能保存放大的位而丢失其余部分数据。
有没有办法使用 matplotlib 获得可滚动的绘图,以便当我将其保存为 png 时,所有内容都包含在内或任何其他格式,这样就不会丢失数据?本质上,我希望情节的长度远大于宽度。
我用来绘制的代码是:
plot1_dataerr = get_plot_data_errbars(processed_answers[0][plot_low:]) #the data to be plotted, the zeroth element of this is the labels, the first is the means and the second is the errorbar size
fig, axs = plt.subplots()
fig.subplots_adjust(left=0.2)
axs.set_xlim([1,5])
axs.grid()
axs.errorbar(plot1_dataerr[1],range(len(plot1_dataerr[1])),xerr = plot1_dataerr[2], fmt = 'k o')
axs.yaxis.set_ticks(np.arange(len(plot1_dataerr[1])))
axs.set_yticklabels(plot1_dataerr[0])
【问题讨论】:
-
您真的显示了所有数据点吗?为什么不对数据进行下采样以适应您的显示方法的分辨率?使用对您的数据类型/问题区域有意义的任何方法进行采样。
标签: python matplotlib plot