has2k1 / plotnine

A Grammar of Graphics for Python
https://plotnine.org
MIT License
4k stars 213 forks source link

parameter scales='free' does not provide independent own label on second axis #633

Closed kraxli closed 1 year ago

kraxli commented 1 year ago

I experience that the parameter scales='free' does not behave as I would expect (potentially my expectation is wrong)

 p9.facet_grid('my_y_ grid_dim ~ my_x_ grid_dim', scales='free')

does not lead to a second independent scaled axis

image

tabedzki commented 1 year ago

Please note that the correct values for facet_grid are ['fixed', 'free', 'free_x', 'free_y']

This can be found from https://plotnine.readthedocs.io/en/stable/generated/plotnine.facets.facet_grid.html

Using scales='free_y" produce your intended behavior

has2k1 commented 1 year ago

The description in the documentation is not accurate. The was changed to match ggplot2, so the scales only vary along the rows and/or columns and not per individual facet.

has2k1 commented 1 year ago

Corrected in https://github.com/has2k1/plotnine/commit/4992e3c3e79cc5c9faa7f34d86c7ad8bc80c115a.