# Plot size() not affecting figure size?

**URL:** https://discourse.julialang.org/t/plot-size-not-affecting-figure-size/16754
**Category:** New to Julia
**Tags:** pyplot
**Created:** [October 24, 2018, 6:48pm UTC](https://discourse.julialang.org/t/plot-size-not-affecting-figure-size/16754 "2018-10-24T18:48:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [October 24, 2018, 6:48pm UTC](https://discourse.julialang.org/t/plot-size-not-affecting-figure-size/16754/1 "2018-10-24T18:48:31Z")

</div>

I am not sure if I am doing something wrong, apparently that should work. The “size” function is not affecting the plot output size, in:

```julia
using PyPlot
x = [1,2]
y = x
plot(x,y)
size(10,200)
savefig("./test.png")

```

I tried also

`savefig("./test.png",figsize=(10,200))`  
or  
`savefig("./test.png",width=10,height=200)`

Without any result either.  
Thank you for your help.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [October 25, 2018, 2:44pm UTC](https://discourse.julialang.org/t/plot-size-not-affecting-figure-size/16754/2 "2018-10-25T14:44:14Z")

</div>

I believe `size(10, 200)` simply calls `size(x::Number, d)`, and returns `1` (as `10` is a scalar).

I haven’t really used PyPlot in Julia for a while other than through Plots.jl, but in Python I would do something like:

```julia
fig, ax = subplots(figsize=(10,10))
ax[:plot](rand(100))

```

Which does change the figure size for me. (Note that in 1.0 I think PyPlot has gained the ability to understand dot notation so you can possibly write `ax.plot`)

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [October 25, 2018, 5:25pm UTC](https://discourse.julialang.org/t/plot-size-not-affecting-figure-size/16754/3 "2018-10-25T17:25:14Z")

</div>

Thank you. I was not aware that the reasonable choice was to use Plots. This works:

```julia
using Plots
x = [1,2]
y = x
plot(x,y)
plot!(size=(400,400))
savefig("test.pdf")

```
