Is there a way to generate Retina graphs using 'matplotlib'?

我怕爱的太早我们不能终老 提交于 2019-12-06 03:19:35

Are you using 'Agg' mode (standard) to create PNG Graphs?

You can create SVG Graphs with Matplot lib which have way better quality using

matplotlib.use('svg')
tacaswell

If you look into texmanager.py you see that it makes the png by a call to dvipng and the function that makes the system call to dvipng has an argument for dpi

To get higher resolution TeX on a per-figure basis for existing figures

plt.gcf().canvas.renderer.dpi = what_ever_retina_dpi_is

to set it everywhere, you should be able to set the rcparam figure.dpi which will be respected when creating new renderers.

I can't test this as I do not have access to a Mac with a Retina display.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!