Gadfly Geom.subplot_grid manual range

190 views
Skip to first unread message

Luca Rossetto

unread,
May 6, 2015, 3:05:02 AM5/6/15
to julia...@googlegroups.com
I was trying to manually specify the range for a plot containing multiple subplots in Gadfly. The range of the values on the x axis is [0, 1] yet the plot goes from [-0.5, 1] effectively wasting 1/3 of the space. When I try to specify the range using
Coord.cartesian(xmin=0)

I get an error telling me that the plot uses multiple coordinates. The plot call looks like this:
plot( d, x=:x, y=:y, color=:group, xgroup=:dist, Geom.subplot_grid(Geom.point), Coord.cartesian(xmin=0), Guide.XLabel("..."), Guide.YLabel("..."), Theme(background_color=color("white")))

Is there a way to specify xmin and xmax in subplot_grid or is that simply not yet supported?

Hanspeter Höschle

unread,
May 20, 2016, 10:54:04 AM5/20/16
to julia-users
Hi Luca,

I had similar issues.
This is what worked for me:
sg = Geom.subplot_grid(Geom.point)
sg.coord =
Coord.cartesian(xmin=0)
plot
( d, x=:x, y=:y, color=:group, xgroup=:dist, sg, Guide.XLabel("..."), Guide.YLabel("..."), Theme(background_color=color("white")))

Somehow the attribute coord is not accessible via the constructor. This is a small detour the works. If it is a nice solution, I can't say
Reply all
Reply to author
Forward
0 new messages