# Plot3d: how to set size of graph, or size of GIF file generated from one

**URL:** <https://discourse.julialang.org/t/plot3d-how-to-set-size-of-graph-or-size-of-gif-file-generated-from-one/25738>\
**Category:** General Usage\
**Tags:** pyplot\
**Created:** [June 26, 2019, 6:10pm UTC](https://discourse.julialang.org/t/plot3d-how-to-set-size-of-graph-or-size-of-gif-file-generated-from-one/25738 "2019-06-26T18:10:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fusion809](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fusion809/32/6080_2.png) [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Post date:** [June 26, 2019, 6:10pm UTC](https://discourse.julialang.org/t/plot3d-how-to-set-size-of-graph-or-size-of-gif-file-generated-from-one/25738/1 "2019-06-26T18:10:54Z")

</div>

Out of the answer I got from [How to create an animation based on t, x, y and z data? - #6 by fusion809](https://discourse.julialang.org/t/how-to-create-an-animation-based-on-t-x-y-and-z-data/25672/7) I’ve now got Julia code that works in generating a 3D animation of chaotic attractors, like the Rossler Attractor. The problem is the resolution. Presently the resolution of the generated GIF is fairly low, and I’d like a HD GIF (1920x1080). This is the code I have been trying:

```julia
# define the Rossler attractor
using Plots;
mutable struct Rossler
    dt; a; b; c; x; y; z
end

function step!(l::Rossler)
    dx = -l.y-l.z ; l.x += l.dt * dx
    dy = l.x + l.a*l.y ; l.y += l.dt * dy
    dz = l.b+l.z*(l.x-l.c) ; l.z += l.dt * dz
end

attractor = Rossler((dt = 0.1, a = 0.2, b = 0.2, c = 14, x = 1., y = 1., z = 1.)...)

# initialize a 3D plot with 1 empty series
plt = plot3d(1, xlim=(-25,25), ylim=(-25,25), zlim=(0,90),
                title = "Rossler Attractor", marker = 2, 
                xlabel="x", ylabel="y", zlabel="z",
                size="(1920, 1080)",
                label="")

# build an animated gif by pushing new points to the plot, saving every 10th frame
@gif for i=1:20000
    step!(attractor)
    push!(plt, attractor.x, attractor.y, attractor.z)
end every 10

```

Before adding the `size=` field in `plot3d` this code ran fine, aside from producing a low-res GIF. Since adding it (and I assumed this would do what I want based on the [plotting attributes page](https://docs.juliaplots.org/latest/attributes/) and the fact it mentions a `size=` argument of the format I used) I’m now getting the error:

```julia
MethodError: no method matching *(::Char, ::Measures.Length{:mm,Float64})
Closest candidates are:
  *(::Any, ::Any, !Matched::Any, !Matched::Any...) at operators.jl:502
  *(::Union{AbstractChar, AbstractString}, !Matched::Union{AbstractChar, AbstractString}...) at strings/basic.jl:229
  *(!Matched::Number, ::Measures.Measure) at /home/fusion809/.julia/packages/Measures/eNttC/src/operations.jl:48
  ...

Stacktrace:
 [1] prepare_output(::Plots.Plot{Plots.GRBackend}) at /home/fusion809/.julia/packages/Plots/oiirH/src/plot.jl:257
 [2] show(::IOStream, ::MIME{Symbol("image/png")}, ::Plots.Plot{Plots.GRBackend}) at /home/fusion809/.julia/packages/Plots/oiirH/src/output.jl:197
 [3] png(::Plots.Plot{Plots.GRBackend}, ::String) at /home/fusion809/.julia/packages/Plots/oiirH/src/output.jl:8
 [4] frame(::Animation, ::Plots.Plot{Plots.GRBackend}) at /home/fusion809/.julia/packages/Plots/oiirH/src/animation.jl:20
 [5] frame(::Animation) at /home/fusion809/.julia/packages/Plots/oiirH/src/animation.jl:18
 [6] macro expansion at /home/fusion809/.julia/packages/Plots/oiirH/src/animation.jl:152 [inlined]
 [7] macro expansion at ./In[6]:30 [inlined]
 [8] macro expansion at /home/fusion809/.julia/packages/Plots/oiirH/src/animation.jl:163 [inlined]
 [9] top-level scope at ./In[6]:26 [inlined]
 [10] top-level scope at ./none:0

```

I haven’t the foggiest as to how I am meant to fix this error while still achieving what I want. Any ideas?

---

<div class="post-metadata">

**Author:** ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Post date:** [June 26, 2019, 8:43pm UTC](https://discourse.julialang.org/t/plot3d-how-to-set-size-of-graph-or-size-of-gif-file-generated-from-one/25738/2 "2019-06-26T20:43:29Z")

</div>

`size` needs a tuple, not a string. Try:

```julia
plt = plot3d(1, xlim=(-25,25), ylim=(-25,25), zlim=(0,90),
                title = "Rossler Attractor", marker = 2, 
                xlabel="x", ylabel="y", zlabel="z",
                size=(1920, 1080),
                label="")

```

---

<div class="post-metadata">

**Author:** ![fusion809](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fusion809/32/6080_2.png) [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Post date:** [June 26, 2019, 9:49pm UTC](https://discourse.julialang.org/t/plot3d-how-to-set-size-of-graph-or-size-of-gif-file-generated-from-one/25738/3 "2019-06-26T21:49:35Z")

</div>

Any ideas why now the z label isn’t shown now (although, I still specify it as a plot3d argument)?

 ![tmp](https://global.discourse-cdn.com/julialang/original/3X/c/2/c29e17743fe14c4cf3ba9393cd02fbb03018b289.gif)

x and y labels are shown, albeit they’re quite small.
