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

addEventLines() for multiple panels #420

Closed
ethanbsmith opened this issue Jun 3, 2024 · 4 comments
Closed

addEventLines() for multiple panels #420

ethanbsmith opened this issue Jun 3, 2024 · 4 comments
Milestone

Comments

@ethanbsmith
Copy link
Contributor

ethanbsmith commented Jun 3, 2024

Description

addEventLines() current only draws on a single panel or adds a new panel. this is cumbersome when needing to add the same even to multiple panels. eg, see attached image

Expected behavior

would be nice if the on parameter either supported a vector of panels, or maybe a special value (like NULL) which would draw the event across all panels

Minimal, reproducible example

image

@joshuaulrich
Copy link
Owner

Thanks for the report. Here's an example.

library(xts)
data(sample_matrix)
x <- as.xts(sample_matrix)
plot(x, multi.panel = TRUE)
addEventLines(xts("a", index(x)[10]), pos = 4)

Setting on to a vector of panel numbers errors. This also fails for addLegend().

addEventLines(xts("a", index(x)[10]), pos = 4, on = 1:4)
addLegend(on = 1:4)

@joshuaulrich
Copy link
Owner

@ethanbsmith please see if that patch works for you.

@ethanbsmith

This comment was marked as resolved.

@joshuaulrich joshuaulrich added this to the Next release milestone Jun 3, 2024
@ethanbsmith
Copy link
Contributor Author

for the record, this crash under 4.4.0 was a build issue on my machine. works fine

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

2 participants