如何根据变量将点大小添加到Gadfly(Julia)散点图
我正在尝试重现 this 使用gadfly使用gadfly。
到目前为止,我拥有的代码是:
using CSV, DataFrames, Gadfly
download("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/mpg.csv", "mpg.csv");
mpg = DataFrame(CSV.File("mpg.csv"));
p = plot(
mpg,
x = :horsepower,
y = :mpg,
color = :origin,
#size = :weight,
alpha = [0.5],
Geom.point,
Theme(background_color = "white"),
)
如何添加圆的大小以匹配汽车权重
并将其添加为第二个传说?
I am trying to reproduce this Seaborn plot using Gadfly.
The code I have so far is:
using CSV, DataFrames, Gadfly
download("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/mpg.csv", "mpg.csv");
mpg = DataFrame(CSV.File("mpg.csv"));
p = plot(
mpg,
x = :horsepower,
y = :mpg,
color = :origin,
#size = :weight,
alpha = [0.5],
Geom.point,
Theme(background_color = "white"),
)
How do I add the size of the circles to match the car weight
and add this as a second legend?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅话语:
See detailed answer by Evan Fields on Discourse: