Hello,

Is there a way to put a custom 2 rows table with its columns alignment as a
subtitle in ggplot? As an example I'm using the code below but it is not
aligned as I want,

tickers.clean <- paste(str_replace_all(tickers,'.SA$', ''))
tickers.subtitle  <- paste(tickers.clean, sep = ' ', collapse = '    ')
ticker.subtitle.weights  <- paste(percent(wts, accuracy = 0.1), sep = ' ',
collapse = '    ')

ggplot(aes(x = date, y = cum_ret)) +
labs(x = 'Date',
        y = 'Cummulative Return',
         title = paste0('Portfolio Return ', length(tickers.clean), ' on ',
                        limite_data_final,
                        ' since ',
                        limite_data_inicial),
         subtitle = paste('Ativos: ', tickers.subtitle,
                          '\nPesos: ', ticker.subtitle.weights)
         )
)

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