plotnine icon indicating copy to clipboard operation
plotnine copied to clipboard

Adding subtitle and caption

Open ghost opened this issue 6 years ago • 9 comments

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")

image

# The caption appears in the bottom-right, and is often used for
# sources, notes or copyright
p + labs(caption = "(based on data from ...)")

image

ghost avatar Aug 16 '18 04:08 ghost

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.

has2k1 avatar Aug 16 '18 13:08 has2k1

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.

raijinspecial avatar Oct 07 '18 20:10 raijinspecial

would also appreciate subtitle and caption. Thank you for this great package.

gresch avatar Nov 18 '18 10:11 gresch

Same!

jaybundy avatar Apr 02 '19 19:04 jaybundy

I would also really appreciate this feature. Thanks for plotnine!

quadrismegistus avatar Nov 23 '20 17:11 quadrismegistus

Echoing the above sentiment! :)

gucciwang avatar Feb 10 '21 01:02 gucciwang

Thank you for all the hard work. Closely following this feature request :)

himalayajung avatar Mar 17 '21 17:03 himalayajung

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 :/

Ioana-P avatar Mar 23 '21 09:03 Ioana-P

Very much looking forward to seeing this feature land. Thanks for the amazing work on the package so far!

aeturrell avatar Aug 31 '21 14:08 aeturrell

Implemented and shipping soon.

has2k1 avatar May 09 '23 05:05 has2k1

So exciting, thank you so much for adding this

aeturrell avatar May 09 '23 14:05 aeturrell