为Jupyter笔记本调整Julia内核中的绘图大小

时间:2017-05-03 03:11:02

标签: julia jupyter-notebook vega ijulia-notebook

我想知道是否有任何方法可以指定Jupyter中内联图的大小。目前,我使用Vega库,宽度和高度不起作用。有任何解决方法。

3 个答案:

答案 0 :(得分:3)

我不知道Vega,虽然我认为ijulia有一个环境变量。使用Plots,您可以let json = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? Dictionary<AnyHashable, Any>

答案 1 :(得分:3)

要在Jupyter Notebook中使用Vega.jl更​​改绘图大小,请修改widthheight属性:

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

答案 2 :(得分:2)

这应该与Plots.jl一起使用:

using Plots
plot(1:5, size=(1000,1000))