Skip to content

Regression from 0.13.5 to 0.14.1 when using scale_color_cmap_d with geom_line #890

@floringogianu

Description

@floringogianu

Before I was using scale_color_cmap_d to assign each line a color from a cmap, when working with discrete groups. After update this code now throws:

AttributeError: 'scale_color_cmap_d' object has no attribute '_aesthetics'
import plotnine as p9
from plotnine.data import meat

meat_long = meat.melt(
    id_vars="date",
    value_vars=["beef", "veal", "pork", "lamb_and_mutton", "broilers", "turkey"],
    var_name="animal",
    value_name="weight"
).dropna()

(
    p9.ggplot(meat_long, p9.aes(x="date", y="weight", color="animal"))
    + p9.geom_line(show_legend=False)
    + p9.theme_classic()
    + p9.scale_color_cmap_d("viridis")
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions