has2k1 / plotnine

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

ggtitle or labs(title=) align left instead of center after updating from 0.10.1 to 0.12.3 #718

Closed ker2xu closed 10 months ago

ker2xu commented 10 months ago

from plotnine import ( ggplot, aes, geom_point, facet_grid, labs, guide_legend, guides, theme, element_text, element_line, element_rect, theme_set, theme_void ) from plotnine.data import mtcars p1 = (ggplot(mtcars, aes('wt', 'mpg', color='factor(cyl)'))

ker2xu commented 10 months ago

I do not know the changed behaviour is expected or not. But I found solution here https://stackoverflow.com/questions/40675778/center-plot-title-in-ggplot2 If you think the behaviour (align left by defaults) is expected, just close the issue.

has2k1 commented 10 months ago

The changed behaviour is expected. Titles were centered by default only because it wasn't easy to left align them. v0.12+ gained a layout manager that made it possible to align text around the axes and therefore easily have left aligned titles.