Add support for captions and subtitles
Open
Nobody has claimed this yet.
enhancement
ggplotly
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
This example shows the difference between ggplot and ggplotly objects regarding the use of "labs".
Source: R for Data Science
library(ggplot2)
library(plotly)
p<-ggplot(mpg, aes(displ, hwy)) +
geom_point(aes(color = class)) +
geom_smooth(se = FALSE) +
labs(
title = "Fuel efficiency generally decreases with engine size",
subtitle = "Two seaters (sports cars) are an exception because of their light weight",
caption = "Data from fueleconomy.gov"
);
p # This is ok, a ggplot2 object
g <- ggplotly(p)
g # "labs()" Just showing title (centered) and subtilte & caption are not even showing up
labs() OK

labs() not ok

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation file or test is named. Reproduce the supplied ggplot2 and ggplotly example first, then trace the conversion path for labs(); done means the resulting plot displays both the subtitle and caption as shown in the source ggplot.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100