plotnine
plotnine copied to clipboard
Adding subtitle and caption
It would be nice to have the caption and subtitle fields.
From https://ggplot2.tidyverse.org/reference/labs.html
p + labs(title = "New plot title", subtitle = "A subtitle")
# The caption appears in the bottom-right, and is often used for
# sources, notes or copyright
p + labs(caption = "(based on data from ...)")
It is related to the same issue (Layout Manager) holding back 46. Trying to implement it without an easy to use Layout Manager would be messy and hard.
As an additional feature, would it be possible to obtain regression coefficients like r and r^2 when plotting with stat_ or geom_smooth('lm' or 'ols') and have them print anywhere on the figure? I'm sorry if this is already possible and I have not figured it out.
would also appreciate subtitle and caption. Thank you for this great package.
Same!
I would also really appreciate this feature. Thanks for plotnine!
Echoing the above sentiment! :)
Thank you for all the hard work. Closely following this feature request :)
I would also really appreciate this feature; btw Plotnine is amazing, thanks for all your hard work.
If anyone needs an slightly hacky, interim method for getting a subtitle that works most of the time, what I've done recently is (for single plots) I've made them into a 1 by 1 facet plot.
So in pandas I set the subtitle as an additional column, with the same value throughout (e.g., df['subtitle'] = "Subtitle text"
and passed that as the faceting variable into facet_wrap.
You can then use the theme params for strip_text
to make it look as similar to a ggplot sub-title as possible. Naturally this won't work with actual faceted plots, but it's a start. :)
Haven't figured out anything for captions, yet :/
Very much looking forward to seeing this feature land. Thanks for the amazing work on the package so far!
Implemented and shipping soon.
So exciting, thank you so much for adding this