Hello,

Suppose I want to have a multiline subtitle using ggplot() with aligned
strings between first line and second line like a table.  I'm using the
approach below to no avail,

tickers.subtitle <- c("CPFE3.SA",  "CXSE3.SA", " ALUP11.SA",  "BBAS3.SA",  "
CMIG4.SA",  "VALE3.SA", " LEVE3.SA", "VIVT3.SA", "TAEE4.SA", "RANI3.SA", "
BRSR6.SA", "SAPR4.SA")
ticker.subtitle.weights <- c("20.0%",   "15.0%",  "15.0%",  "5.0%", "5.0%",
"5.7%", "5.7%", "5.7%", "5.7%", "5.7%", "5.7%", "5.7%")

port_cumulative_ret %>% ggplot(aes(x = date, y = cum_ret)) +
...
labs(
...
subtitle = paste('Ativos: ', tickers.subtitle,
                          '\nPesos: ', ticker.subtitle.weights)
)

Any suggestions?

TIA,

--
André Luiz Tietbohl Ramos, PhD

        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to