Skip to content

Custom theme with quantmod library

6 messages · Andre Luiz Tietbohl Ramos, Ilya Kipnis, Enrico Schumann

#
Hello,

Is there a way to customize quantmod theme colors?  This great library
works fine however I rather change its color theme.  So far, I have been
able to use both white and black themes.
I tried to use the chartSeries theme command described below to no avail.
I tried even without a theme name, e.g. white or black. An example is below,

stock.plot <- chartSeries(stock.time_interval,  ## ativo,
                          name = stock.name,
                          type = "candlestick",
                          subset='2025-07::2026-01',
                          theme = chartTheme("white", up.col='darkgreen',
dn.col='darkred',
                                             bg.col='gray',
selection.color='gray'),
                          TA = NULL
                          )

Could anyone help, please?

TIA,

--
Andre Luiz Tietbohl Ramos, PhD
#
Sounds like this might be a setting in RStudio, if you're using that.

If in RStudio: tools -> global options -> appearance -> customize.

On Wed, Jan 14, 2026 at 12:06?PM Andre Luiz Tietbohl Ramos <
andreltramos at gmail.com> wrote:

            

  
  
#
Dear Ilya,

Thanks for the reply!  However, I'm using emacs + ess + R in OSX.


Regards,

--
Andr? Luiz Tietbohl Ramos, PhD.
On Wed, Jan 14, 2026 at 2:10?PM Ilya Kipnis <ilya.kipnis at gmail.com> wrote:

            

  
  
#
On Wed, 14 Jan 2026, Andre Luiz Tietbohl Ramos writes:
With quantmod 0.4.28 and R 4.5.2, and ESS (but on GNU/Linux),
I can change colours, e. g.

    library("quantmod")
    getSymbols("AAPL")
    
    chartSeries(
        AAPL,
        type = "candlestick",
        subset = '2025-07::2026-01',
        theme = chartTheme("black",
                           up.col = "blue"))

gives me "blue" up-bars.  The same example also works
when I run it from a terminal.

Could this be some Apple-specific thing?
#
On Thu, 15 Jan 2026, Enrico Schumann writes:
What happens when you send the graphic to a PDF, e.g.:

    pdf("some-file-name.pdf")
    library("quantmod")
    getSymbols("AAPL")
    
    chartSeries(
        AAPL,
        type = "candlestick",
        subset = '2025-07::2026-01',
        theme = chartTheme("black",
                           up.col = "blue"))
    dev.off()

Does the colour show up?
#
Hello everyone,

Thanks for the replies received so far.
The answer received is none with the output below,
1

I guess it may be related to one of the several libraries loaded by default
at startup via .Rprofile.  However,
at the same time, I don't know which one or even if that could be the issue.
My main interest is only to change the inner plot area background.  I can
change its color in the outer region
along the plot itself.

Regards,

--
Andr? Luiz Tietbohl Ramos, PhD


On Thu, Jan 15, 2026 at 10:11?AM Enrico Schumann <es at enricoschumann.net>
wrote: