[英]How to add point size to a Gadfly (Julia) scatter plot based on a variable
I am trying to reproduce this Seaborn plot using Gadfly.我正在尝试使用 Gadfly 重现这个Seaborn 情节。
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?如何添加圆圈的大小以匹配汽车
weight
并将其添加为第二个图例?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.