我使用Gadfly绘制图层,如何更改顺序?
我已经尝试过按照文档操作,但它不起作用。
using DataFrames
df = readtable("data/01_heights_weights_genders.csv")
xmin, xmax = extrema(df[:Height])
ymin, ymax = extrema(df[:Weight])
plot(layer(df, x="Height", y="Weight", Geom.point, color="Gender", order = 1),
layer(x=[xmin, xmax],y=[ymin, ymax], Geom.point,Geom.line, Theme(default_color=colorant"purple"), order = 10))
答案 0 :(得分:1)
解决了
plot(df,layer(x="Height", y="Weight", Geom.smooth(method=:lm,smoothing=0.2), Theme(default_color=colorant"red")),
layer(x="Height", y="Weight", Geom.point))