Dear Ilya,

Thanks for the prompt reply!  The code from my previous message works and I
uploaded as an example so you could see what my intent is.  Your suggestion
will be considered, thank you! Its output is attached (which is in
Portuguese).

Thanks,

--
André Luiz Tietbohl Ramos, PhD


On Mon, Feb 2, 2026 at 12:56 PM Ilya Kipnis <[email protected]> wrote:

> This isn't a reproducible example--we don't have the stocks data frame.
> Also, it is bad practice to use dplyr in the R/Finance stack as it
> overrides multiple functions, such as lag and filter.
>
> On Mon, Feb 2, 2026 at 8:39 AM Andre Luiz Tietbohl Ramos <
> [email protected]> wrote:
>
>> Hello,
>>
>> Is it possible to customize the x-axis label? Using ggplot I have the
>> custom x-label described below,
>>
>> stocks %>%
>> ggplot(aes(x = date, y = cum_ret)) +
>>     theme_gray() +
>>     theme(plot.background = element_rect(fill = "gray86")) +
>>     geom_line(color = "blue") +
>>     *theme(axis.text.x = element_text(angle = 50, hjust = 1))* +
>>     labs(x = 'Data',
>>          y = 'Cumulative Return',
>>          title = paste0('Portfolio Cumulative Return of ',
>> length(tickers.clean), ' stocks on ',
>>                         format(as.Date(end), format="%d/%m/%Y")),
>>          subtitle = paste0("Ativos: ", toString(tickers.clean),
>> "\nWeights:
>> ",
>>                            toString(percent(wts, accuracy = 0.1)))
>>          ) +
>>
>>
>>
>>
>> * scale_x_date(date_breaks = '2 weeks',
>> date_labels = '%d %b %y') +    scale_y_continuous(        breaks = seq(0,
>> 10, 0.05),        labels = scales::percent_format(accuracy = 1)*
>>     )
>>
>> TIA,
>>
>> --
>> Andre Luiz Tietbohl Ramos, PhD
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> [email protected] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only. If you want to post, subscribe first.
>> -- Also note that this is not the r-help list where general R questions
>> should go.
>>
>

Attachment: Retorno_Acumulado_do_Portfolio_KNCA11,CRAA11,RURA11,XPCA11,HGAG11,IAGR11,RZAG11,LSAG11,VGIA11,MXRF11,VINO11_em_21-11-2025.pdf
Description: Adobe PDF document

_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should 
go.

Reply via email to