Resizing plots in the Julia kernel for Jupyter notebooks
Asked Answered
U

3

5

I want to know if there is any way that I can specify the size of the inline-plots in Jupyter. At the moment, I use Vega library and width and height don't work. There is any workaround.

Urian answered 3/5, 2017 at 3:11 Comment(1)
what backend are you using for plotting? PyPlot? GR? This question also applies if you are using Plots.jl since Plots.jl also offers backend selection possibility.Unbreathed
B
3

I don't know about Vega, though I think there is an environmental variable for ijulia. Using Plots, you can just default(size = (1000, 300)).

Bernardo answered 4/5, 2017 at 7:46 Comment(3)
Thx but that doesn't work with me even with Plots library.Urian
That's weird thoughBernardo
this seems to work on Juliabox, but doesn't work offlineInexcusable
T
3

To change the plot size using Vega.jl within Jupyter Notebook, you modify the width and height properties:

using Vega

#defaults are width = 450 and height = 450
b = barplot(x = [1,2,3], y = [1,2,3]) 

#change to whatever values you want
b.width = 200
b.height = 50

#re-render
b

enter image description here

Trapezohedron answered 26/3, 2019 at 13:13 Comment(0)
B
2

This should work with Plots.jl:

using Plots
plot(1:5, size=(1000,1000))
Beatitude answered 26/3, 2019 at 13:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.