Plots.jl: gif size

Created on 28 Feb 2018  路  1Comment  路  Source: JuliaPlots/Plots.jl

I'm trying to minimize the size of a gif I'm making by adjusting the size property. While using the gr backend I get (one per frame) GKS: Rectangle definition is invalid in routine SET_VIEWPORT when trying to have a small slide size. I quickly found out that the spatial size of the resulting gif is 6 times larger than whatever I supply size with.
Consider this MWE:

using Plots
anim = Animation()
for i in 1:100
    h = [plot(rand(10)) for i in 1:4]
    plot(h..., size = (100,100))
    frame(anim)
end
gif(anim, "a.gif", fps = 30)

This spits tons of GKS messages and results in a gif that is 600脳600 pixels large. Weird.
I'll just add that if we had just one plot instead of 4 subplots the GKS warnings disappear but the file is still 600脳600 pixels large...

Most helpful comment

So in reference to all the dpi issues, I found out that the magical dpi that makes gif sizes work in gr is (drum-roll) 50/3.

>All comments

So in reference to all the dpi issues, I found out that the magical dpi that makes gif sizes work in gr is (drum-roll) 50/3.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mkborregaard picture mkborregaard  路  3Comments

Krastanov picture Krastanov  路  3Comments

dancsi picture dancsi  路  4Comments

daschw picture daschw  路  3Comments

nebuta picture nebuta  路  3Comments