【发布时间】:2019-08-15 02:43:57
【问题描述】:
我正在尝试弄清楚如何在 python 中执行此操作,因为我对它与 R 相比有点新。
import plotnine as p9
import pandas as pd
import numpy as np
###load the data here...
dataset=pd.read_csv('https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/raw/d546eaee765268bf2f487608c537c05e22e4b221/iris.csv')
什么不工作的例子......不知道我做错了什么......
p9.ggplot(dataset, p9.aes(x='sepal_width'))+p9.geom_density()+p9.geom_vline( p9.aes(xintercept='sepal_length.mean()', color='species'))
为什么颜色不起作用?我想要一个具有适当颜色的垂直线组
如果我能叠加直方图也很棒。
【问题讨论】: