使用Gadfly的Julia中的子图
大家好, 我想使用Gadfly在Julia中为两个不同的函数/数组创建子图网格。
例如:
1. Gadfly.plot(x=rand(20),y=rand(20))
Gadfly.plot(x=rand(10),y=rand(10))
以下链接显示了使用Geom.subplot_grid的基于DataFrame的子图网格的示例。但是我找不到函数/数组的任何示例。 http://gadflyjl.org/v0.6.4/lib/geoms/geom_subplot_grid.html
有人可以帮我吗? 预先感谢
答案 0 :(得分:0)
您可以使用Stacks
来实现所需的目标。
p1 = Gadfly.plot(x=rand(20),y=rand(20))
p2 = Gadfly.plot(x=rand(10),y=rand(10))
stack = hstack(p1, p2) # will arrange the plots horizontally
title(stack, "Horizontally Stacked Plots") # let's give a title
您可以结合使用hstack
和vstack
来创建任意的地块布置。还请查看gridstack
,这有时会使事情变得更容易。请参阅the Stacks section in manual,以了解有关Stacks
的更多信息。