简体   繁体   English

如何在yhat的python ggplot中禁用颜色条?

[英]How to disable colorbar in yhat's python ggplot?

How does one disable colorbar in a plot like so: 如何在这样的图中禁用颜色条:

ggplot(
    aes(x='X',
        y='Y',
        color='C'),
    data=data_df
) + geom_line() + facet_grid("U", "V")

The problem is that C is of a large cardinality and the point of the plot is just to see the various shapes altogether and not to label them. 问题在于C具有很大的基数,并且绘图的重点只是完全看到各种形状而不是对其进行标记。

This is no direct answer, but after checking the github I don't think it is implemented yet. 这不是直接的答案,但是在检查了github之后,我认为它尚未实现。 I would advise you to use plotnine , which is also a ggplot wrapper for mpl - but still under development. 我建议您使用plotnine ,它也是mpl的ggplot包装器-但仍在开发中。

Eg: 例如:

from plotnine import *
from plotnine import data
(ggplot(data.mtcars, aes('wt', 'mpg', color='factor(gear)'))
 + geom_point(show_legend = False))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM