This may look similar to this question: How to format two Axes in Plotly using R? but it is not. Plus this one doesn't have any responses.
I am trying to have three subplots (all time-series) one under the other using Plot_ly in R. While the plots are correct, I want their x-axis i.e. date-time ranges to be same. At the moment the third plot has time stamp starting from 8 AM whereas others have it starting at 00:00 AM. I would like my third plot also to be starting at 00:00 AM even if there are no values there. This would make visual comparison much easier. Here is my code snippet:
pWrist <- plot_ly(combinedCounts, x = ~DATE_TIME, y= ~Vector.Magnitude_ANKLE, name = "ANKLE_COUNTS", legendgroup = "ANKLE", type = "bar")
pAnkle <- plot_ly(combinedCounts, x = ~DATE_TIME, y= ~Vector.Magnitude_WRIST, name = "WRIST_COUNTS", legendgroup = "WRIST", type = "bar")
pResponses <- plot_ly(uEMAResponsesOnly, x=~PROMPT_END_TIME, y=~RESPONSE_NUMERIC, name = "uEMA_RESPONSES", legendgroup = "uEMA", type = "bar")
subplot( style(pWrist, showlegend = TRUE), style(pAnkle, showlegend = TRUE), style(pResponses, showlegend = TRUE), nrows = 3, margin = 0.01)
The subplot function puts them all one under the other. Any help or information is appreciated.
**EDIT: **Here is what it looks like right now. I just want the third axis also to start from the same time as the first two. As you can see, the third one starts at 8 AM. Current plot