Skip to content

geom_col() with categories on vertical axis does not render correctly #917

Open
@christophscheuch

Description

@christophscheuch

I'm using plotnine version 0.14.5. The following code

from plotnine import ggplot, aes, geom_col, coord_flip
from plotnine.data import mtcars

(ggplot(mtcars, aes(y = "factor(gear)", x = "mpg"))
    + geom_col()
)

produces this figure

Image

However, we should expect this:

Image

which I created using coord_flip():

(ggplot(mtcars, aes(x = "factor(gear)", y = "mpg"))
    + geom_col()
    + coord_flip()
)

I noticed this issue in a more complex project and created this reprex for illustration.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions