forked from GiovineItalia/Gadfly.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
subplot_layers.jl
29 lines (20 loc) · 864 Bytes
/
subplot_layers.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using DataFrames, Distributions, Gadfly
df = DataFrame(
RN = rand(1:100, 400),
Dens = rand(Normal(450, 100), 400),
Type = vcat(fill("Mature", 100),
fill("MidU", 100),
fill("MidT", 100),
fill("Young", 100)))
pl = plot(df, x = "RN", y = "Dens",
ygroup="Type",
Theme(panel_stroke=color("grey"), stroke_color=identity),
Guide.xlabel("Cambial age (years)"),
Guide.ylabel("Wood density (kg m<sup>3</sup>)"),
Scale.x_continuous(minvalue=0, maxvalue=100, format=:plain),
Scale.y_continuous(minvalue=300, maxvalue=900),
Geom.subplot_grid(
layer(Geom.point, Theme(default_color=color("gray"))),
layer(Geom.smooth, Theme(default_color=color("red"))),
Guide.xticks(ticks=[0, 25, 50, 75, 100])
))