Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resizing plots in the Julia kernel for Jupyter notebooks

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.

like image 591
bensw Avatar asked May 03 '17 03:05

bensw


Video Answer


3 Answers

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)).

like image 92
Michael K. Borregaard Avatar answered Oct 13 '22 20:10

Michael K. Borregaard


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

like image 23
Randy Zwitch Avatar answered Oct 13 '22 21:10

Randy Zwitch


This should work with Plots.jl:

using Plots
plot(1:5, size=(1000,1000))
like image 28
Mauro Avatar answered Oct 13 '22 20:10

Mauro