8000 geom_point happily colorizes unfilled_shapes on main plot but shows only black on legend · Issue #100 · has2k1/plotnine · GitHub
[go: up one dir, main page]

Skip to content
geom_point happily colorizes unfilled_shapes on main plot but shows only black on legend #100
@jrbrearley

Description

@jrbrearley

Showing colors on a graph but not on the legend is inconsistent. My preference would be to show the colors on the legend as well as the main plot. I suppose black everywhere would also be a answer.

Here is the short script to demonstrate the issue:

import pandas, plotnine
from plotnine.data import diamonds
# NB: shapes used by geom_point are defined in plotnine/scales/scale_shape.py
g0 = plotnine.ggplot(plotnine.aes(x='carat', y='price', fill='color'), data=diamonds)
g1 = g0 + plotnine.geom_point(shape=1) # Legend all black
print(g1)
g2 = g0 + plotnine.geom_point(shape='s') # Legend correctly colorized
print(g2)

I did try adding parameters 'color=fill' 'color=color' & fill='color' to try and get the legend colorized, but no luck

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0