Closed luifrancgom closed 8 months ago
Plotnine does not yet automatically detect the orientation of the plot based on the mappings. For now you have to map the discrete variable to the x
aesthetic and then use coord_flip
.
(ggplot(data=df, mapping=aes(x="name", y="disp"))
+ geom_col()
+ coord_flip()
)
Thank you @has2k1. In this case what you recommend in relation to this issue. Should I close it or you will label it as a possible enhancement in a distant future in relation to detecting the orientation? Please let me know.
Also can you include this solution so I can accept your answer in relation to this post in stackoverflow: https://stackoverflow.com/questions/77656015/problem-using-the-geom-col-in-plotnine-with-linux-ubuntu-22-04-3-lts-and-win?
Description
There is a problem in relation to the labels and the direction of the columns when using
geom_col
Steps to reproduce and actual behavior
Expected behavior
I was expecting a similar result as in the case of R:
Created on 2024-01-12 with reprex v2.0.2
Session information