使用Gadfly的Julia中的子图

时间:2019-01-12 19:01:07

标签: julia

使用Gadfly的Julia中的子图

大家好, 我想使用Gadfly在Julia中为两个不同的函数/数组创建子图网格。

例如: 1. Gadfly.plot(x=rand(20),y=rand(20))

  1. Gadfly.plot(x=rand(10),y=rand(10))

以下链接显示了使用Geom.subplot_grid的基于DataFrame的子图网格的示例。但是我找不到函数/数组的任何示例。 http://gadflyjl.org/v0.6.4/lib/geoms/geom_subplot_grid.html

有人可以帮我吗? 预先感谢

1 个答案:

答案 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

您可以结合使用hstackvstack来创建任意的地块布置。还请查看gridstack,这有时会使事情变得更容易。请参阅the Stacks section in manual,以了解有关Stacks的更多信息。