Aye*_*own 3 python r data-visualization ggplot2 plotnine
我已经使用 ggplot 很长时间了,并且在 R 中使用它非常舒服。我现在正在学校使用 Python,我最难理解这个错误。当我尝试使用 scale_color_manual 将颜色手动分配给名为“CellTypeOther”的具有唯一值 0/1 的变量时,我不断收到以下错误:
NameError: name 'c' is not defined
Run Code Online (Sandbox Code Playgroud)
这是我创建 ggplot 的代码:
from plotnine import *
plot = (
ggplot(Y_tsne,aes(x = 'X',y = 'Y'))
+ geom_point(aes(color = 'CellTypeOther'),alpha = 0.4,size = 2)
+ scale_color_manual(c("blue","red"))
)
Run Code Online (Sandbox Code Playgroud)
没有最后一行,情节渲染得很好。有没有人对可能发生的事情有任何线索?我不能分享我的数据,因为它很敏感。
重要说明:我正在使用 plotnine Python 模块来利用 ggplot2。
| 归档时间: |
|
| 查看次数: |
445 次 |
| 最近记录: |