-
Notifications
You must be signed in to change notification settings - Fork 632
Closed
Labels
Milestone
Description
I'd expect this code example to create facet strips with a fixed height for each panel, but it currently doesn't:
library(plotly)
library(dplyr)
my_plot <- . %>%
plot_ly(x = ~date, y = ~value) %>%
add_annotations(
text = ~unique(variable),
x = 0.5,
y = 1,
yref = "paper",
xref = "paper",
xanchor = "middle",
yanchor = "bottom",
showarrow = FALSE,
font = list(size = 15)
) %>%
layout(
shapes = list(
type = "rect",
x0 = 0,
x1 = 1,
xref = "paper",
y0 = 0,
y1 = 16,
yanchor = 1,
yref = "paper",
ysizemode = "pixel",
fillcolor = toRGB("gray80"),
line = list(color = "transparent")
)
)
economics_long %>%
group_by(variable) %>%
do(p = my_plot(.)) %>%
subplot(nrows = NROW(.), shareX = TRUE)