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

Is it possible to add shapes to interactive time-series plots using plotly::layout? #154

Open
rafabelokurows opened this issue Oct 3, 2023 · 0 comments

Comments

@rafabelokurows
Copy link

First of all, thanks Matt and the other collaborators for all the effort you have put into this package.

I have more of a question than an issue, per se, but I wanted to know whether it is possible to add shapes to the plotly object resulting of timetk's plot_acf_diagnostics (and in extension, to plots resulting from other timetk's functions):

The result I want is something like this:
result
Just as you can do with base plotly, as described here, for instance:
https://plotly.com/r/shapes/

The code I'm trying is:

library(timetk)
library(tidyverse)
library(plotly)
 taylor_30_min %>% 
  plot_acf_diagnostics(date, value,.lags=1:48) %>% 
  plotly::layout( title = 'Test',
          shapes = list(
            list(type = 'circle',
                 xref = 'x', 
                 x0 = 2, x1=5,
                 yref = 'y',
                 y0 = -0.1, y1 = 0.4,
                 fillcolor = 'red', line = list(color = 'red'))))

Is there some way to do this with timetk + plotly? What I am missing here?

Thanks in advance!

@rafabelokurows rafabelokurows changed the title Is it possible to add shapes to interactive time-series plots? Is it possible to add shapes to interactive time-series plots using plotly::layout? Oct 3, 2023
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