Julia: How to save a figure without plotting/displaying it in PyPlot?

淺唱寂寞╮ 提交于 2019-12-04 09:12:53
Alexander Morley

Are you using the REPL or IJulia?

If you close the figure then it won't show you the plot. Is that what you want?

a = rand(50,40)
ioff() #turns off interactive plotting
fig = figure()
imshow(a)
close(fig)

If that doesn't work you might need to turn off interactive plotting using ioff() or change the matplotlib backend (pygui(:Agg)) (see here: Calling pylab.savefig without display in ipython)

Remember that most questions about plotting using PyPlot can be worked out by reading answers from the python community. And also using the docs at https://github.com/JuliaPy/PyPlot.jl to translate between the two :)

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