Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to set color in multiple graphs in one window #385

Open
mytarmail opened this issue May 11, 2023 · 0 comments
Open

how to set color in multiple graphs in one window #385

mytarmail opened this issue May 11, 2023 · 0 comments

Comments

@mytarmail
Copy link

mytarmail commented May 11, 2023

Description

I want to paint several graphs in different colors in one window so that it is convenient to distinguish them
question reposted here

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

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant