joshuaulrich / joshuaulrich/quantmod

how to set color in multiple graphs in one window

Open
#385 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
906
Forks
233
PR merge metrics
No merged PRs in 30d

Description

### Description
I want to paint several graphs in different colors in one window so that it is convenient to distinguish them
[question reposted here](https://stackoverflow.com/questions/76184039/how-to-set-color-in-multiple-graphs-in-one-window-quantmod-package)
### Expected behavior

I want each graph to have its own color,
ideally i want to have access to the main graphics settings of each chart

### Minimal, reproducible example

```r
library(quantmod)
library(xts)

len <- 20000

times <- seq(as.POSIXct("2016-01-01 00:00:00"), length = len, by = "sec")

S1 <- as.xts(cumsum(rnorm(len)),order.by = times)
S1 <- to.period(S1,period = "minutes",k = 5,indexAt = 'startof')

S2 <- as.xts(cumsum(rnorm(len)),order.by = times)
S2 <- to.period(S2,period = "minutes",k = 5,indexAt = 'startof')

S3 <- as.xts(cumsum(rnorm(len)),order.by = times)
S3 <- to.period(S3,period = "minutes",k = 5,indexAt = 'startof')

chart_Series(S1)
add_Series(S2,on = 1)
add_Series(S3,on = 1)
```

### Session Info

```r
sessionInfo()
R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

time zone: Europe/Kiev
tzcode source: internal

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] quantmod_0.4.22 TTR_0.24.3 xts_0.13.1 zoo_1.8-12
[5] mt5R_0.1.5

loaded via a namespace (and not attached):
[1] zoo_1.8-12 compiler_4.3.0 tools_4.3.0 xts_0.13.1 curl_5.0.0
[6] mt5R_0.1.5 grid_4.3.0 TTR_0.24.3 lattice_0.21-8
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.