Hello,

I'm trying to get a custom colour on a plot background to no avail.
I also tried via custom theme and via the rect function described below.

myTheme <- chart_theme()
myTheme$col$bg <- "#6C7B8B"   ## "slategray4" or
myTheme$panel.background$fill <- "slategray4"

## Via set plot region color
rect(
    par("usr")[1],
    par("usr")[3],
    par("usr")[2],
    par("usr")[4],
    col = "slategray4"
)

The solution below keeps the actual plot with white background for only its
borders have the desired colour,

 chartSeries(PETR4.SA,
                          theme = chartTheme('white', up.col = 'darkgreen',
bg.col = "darkgray"),
                          par(lwd = 2),
                          type = "line",
                          bar.type = "hlc",
                          major.ticks='months',
                          minor.ticks=TRUE,
                          show.grid = TRUE,
                          TA = NULL
                          ) + theme(plot.background = element_rect(fill =
"darkgray", color = "darkgray", size = 2))

Suggestions?  Any help greatly appreciated.

Best,

--
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.

Reply via email to