# Png resolution

**URL:** <https://discourse.julialang.org/t/png-resolution/24330>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [May 17, 2019, 4:55pm UTC](https://discourse.julialang.org/t/png-resolution/24330 "2019-05-17T16:55:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pistacliffcho](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pistacliffcho/32/8518_2.png) [@pistacliffcho](https://discourse.julialang.org/u/pistacliffcho)\
**Post date:** [May 17, 2019, 4:55pm UTC](https://discourse.julialang.org/t/png-resolution/24330/1 "2019-05-17T16:55:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jerlich](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jerlich/32/5205_2.png) [@jerlich](https://discourse.julialang.org/u/jerlich)\
**Post date:** [May 18, 2019, 12:45am UTC](https://discourse.julialang.org/t/png-resolution/24330/2 "2019-05-18T00:45:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pistacliffcho](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pistacliffcho/32/8518_2.png) [@pistacliffcho](https://discourse.julialang.org/u/pistacliffcho)\
**Post date:** [May 18, 2019, 1:42am UTC](https://discourse.julialang.org/t/png-resolution/24330/3 "2019-05-18T01:42:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![davide](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davide/32/52136_2.png) [@davide](https://discourse.julialang.org/u/davide)\
**Post date:** [May 18, 2019, 10:01am UTC](https://discourse.julialang.org/t/png-resolution/24330/4 "2019-05-18T10:01:21Z")

</div>

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

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

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

```

```julia

```

---

<div class="post-metadata">

**Author:** ![pistacliffcho](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pistacliffcho/32/8518_2.png) [@pistacliffcho](https://discourse.julialang.org/u/pistacliffcho)\
**Post date:** [May 18, 2019, 9:57pm UTC](https://discourse.julialang.org/t/png-resolution/24330/5 "2019-05-18T21:57:45Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![pistacliffcho](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pistacliffcho/32/8518_2.png) [@pistacliffcho](https://discourse.julialang.org/u/pistacliffcho)\
**Post date:** [May 18, 2019, 10:11pm UTC](https://discourse.julialang.org/t/png-resolution/24330/6 "2019-05-18T22:11:21Z")

</div>

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

![41%20PM](https://global.discourse-cdn.com/julialang/original/3X/9/2/92a3bb8c47e8c5e93635a958bf32d7d1ba7b2c6f.png)

---

<div class="post-metadata">

**Author:** ![davide](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davide/32/52136_2.png) [@davide](https://discourse.julialang.org/u/davide)\
**Post date:** [May 20, 2019, 7:25am UTC](https://discourse.julialang.org/t/png-resolution/24330/7 "2019-05-20T07:25:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Post date:** [May 20, 2019, 2:32pm UTC](https://discourse.julialang.org/t/png-resolution/24330/8 "2019-05-20T14:32:12Z")

</div>

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.
