TyberiusPrime · GitHub

geom_rug takes a sides parameter (lrbt),
which is evaluated after the coord_flip.

This means you need to change your geom_rug call
if you're adding a coord_flip() to a plot.

Example:

import plotnine as p9
from plotnine.data import mtcars
g = p9.ggplot(mtcars,p9.aes('wt','mpg'))
g += p9.geom_point()
g += p9.geom_rug(sides='l')
g

image
and after the coord_flip:

from plotnine.data import mtcars
g = p9.ggplot(mtcars,p9.aes('wt','mpg'))
g += p9.geom_point()
g += p9.geom_rug(sides='l')
g += p9.coord_flip()
g

image

To my mind that is unfortunate, but required for full ggplot2 compability.

I have been thinking we might extend the accepted values of sides to include
perhaps y/Y/x/X which would read 'at y-axis, opposite y-axis ...', which would
flip 'correctly' when coord_flip is applied.

This would maintain ggplot2 compability, while actually improving the situation.
The actual values are of course up to debate.
And it would cause an exception to use both kinds of sides at once in one geom_rug.

Read the original on github.com ↗