# How to change plot size in jupyter?

**URL:** https://discourse.julialang.org/t/how-to-change-plot-size-in-jupyter/11589
**Category:** Visualization
**Tags:** jupyter, plotting
**Created:** [June 11, 2018, 3:55pm UTC](https://discourse.julialang.org/t/how-to-change-plot-size-in-jupyter/11589 "2018-06-11T15:55:47Z")
**Posts on this page:** 6
**Page:** 1

<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: [June 11, 2018, 3:55pm UTC](https://discourse.julialang.org/t/how-to-change-plot-size-in-jupyter/11589/1 "2018-06-11T15:55:47Z")

</div>

Hi,

is it possible to change size of plotted figures in jupyter notebook?  
(E.g., with the R kernel I can use “options(repr.plot.width=4, repr.plot.height=3)” but I didn’t find something similar for the Julia kernel).

Thanks

---

<div class="post-metadata">

### Author: ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)
#### Post date: [June 11, 2018, 7:48pm UTC](https://discourse.julialang.org/t/how-to-change-plot-size-in-jupyter/11589/2 "2018-06-11T19:48:36Z")

</div>

The setting is somewhere in IJulia. Sorry that was super unhelpful. I was looking for the setting but now I can’t seem to find it.

---

<div class="post-metadata">

### Author: ![tlnagy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlnagy/32/5815_2.png) [@tlnagy](https://discourse.julialang.org/u/tlnagy)
#### Post date: [June 11, 2018, 9:54pm UTC](https://discourse.julialang.org/t/how-to-change-plot-size-in-jupyter/11589/3 "2018-06-11T21:54:18Z")

</div>

It depends on which plotting library you are using.

For example, with [`Gadfly.jl`](http://gadflyjl.org/stable/) you can set the plot size using [`Gadfly.set_default_plot_size(10cm, 8cm)`](http://gadflyjl.org/latest/lib/gadfly.html#Gadfly.set_default_plot_size-Tuple%7BUnion%7BMeasures.Measure,%20Number%7D,Union%7BMeasures.Measure,%20Number%7D%7D) and this will be reflected in the Jupyter notebook.

---

<div class="post-metadata">

### Author: ![brilhana](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brilhana/32/2112_2.png) [@brilhana](https://discourse.julialang.org/u/brilhana)
#### Post date: [June 11, 2018, 11:46pm UTC](https://discourse.julialang.org/t/how-to-change-plot-size-in-jupyter/11589/4 "2018-06-11T23:46:18Z")

</div>

If you’re using `Plots.jl` you can do:

```julia
using Plots

x = 1:10
y = rand(10)

plot(x, y, size = (700, 700))

```

---

<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: [June 12, 2018, 5:43am UTC](https://discourse.julialang.org/t/how-to-change-plot-size-in-jupyter/11589/5 "2018-06-12T05:43:55Z")

</div>

Thanks @tlnagy and @brilhana for the Gadfly and Plots methods.

---

<div class="post-metadata">

### Author: ![ZorgroZ](https://avatars.discourse-cdn.com/v4/letter/z/96bed5/32.png) [@ZorgroZ](https://discourse.julialang.org/u/ZorgroZ)
#### Post date: [June 18, 2018, 11:14pm UTC](https://discourse.julialang.org/t/how-to-change-plot-size-in-jupyter/11589/6 "2018-06-18T23:14:21Z")

</div>

For `ggplot2` via `RCall` in `IJulia`:

`RCall.rcall_p(:options, rcalljl_options=Dict(:width => <width>, :height => <height>))`

Full example:

```julia
using RCall
using RDatasets
@rlibrary ggplot2
mtcars = dataset("datasets", "mtcars")
RCall.rcall_p(:options, rcalljl_options=Dict(:width => 1000, :height => 800))
ggplot(mtcars) + aes(x=:MPG, y=:HP) + geom_point()

```

For some more details see file `ijulia.jl` in package `RCall.jl`.
