matplotlib/hist2d生成的绘图在屏幕和pdf fi上看起来不同

2024-03-29 13:49:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用matplotlib2.2.2生成hist2d图。它在屏幕上看起来很好,但是当我把它保存到一个pdf文件中时,框周围有灰色的边缘。为什么?我在使用matplotlib1.5.3时没有遇到这个问题,只是在升级到2.2.2之后。你知道吗

这就是我过去的情节:

ax.hist2d(x, y, bins=(900, 1500), cmap=plt.cm.Reds, norm=mpl.colors.LogNorm())

左侧,您可以看到PDF中显示的带有灰色框的绘图。 右侧的绘图是它在屏幕上的显示方式

plot shows on the screenplot shows on the screen


Tags: 文件绘图normpdf屏幕cmpltax