Png resolution

How can I increase the resolution in a plot saved by png?

Please provide more information about which graphics package you are using.

I’m using the Plots package with the pyplot backend.

You can set the size when plotting, e.g.:

x = 1:12; y = randn(12);

plot(x,y, size=(800,500))
savefig("filename.png")
1 Like

Unfortunately, this is only a partial solution. The issue is that when you resize the plot to be larger, all the text stays the same size.

Now I’m looking into how to resize the text…

Looking into it further, it seems like resizing the plots actually seems to break the functionality of heatmap:

41%20PM

I do not know if there is a way to resize all fonts at once, but you cant set the font size attributes:
titlefontsize, tickfontsize, legendfontsize, guidefontsize

Plots.jl’s heatmap functionality has never been reliable for me with non-default parameters. You may want to try PyPlot.jl for heatmaps–the syntax isn’t as pretty as with Plots, but there’s always a way to get the output you’re looking for. You could also try saving the plot as a vectorized pdf (you’ll need import Plots.pdf), then converting to png using some external tool.