✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚾️ It's finally Baseball season! Root for the home team... & Register for our Sports Analytics Webinar!

Subplots having height < 0.5 not drawn

Hey there,

I encountered an issue in the following situation: Number of subplots >= 3, one height fraction being less than 0.05, and two subplots taking the least space being neighours:

p1 <- plot_ly(economics, x = ~date, y = ~unemploy) %>% add_lines(name = “plot1”)
p2 <- plot_ly(economics, x = ~date, y = ~unemploy) %>% add_lines(name = “plot2”)
p3 <- plot_ly(economics, x = ~date, y = ~unemploy) %>% add_lines(name = “plot3”)

subplot(p1,p2,p3, nrows=3, heights=c(0.9,0.05,0.05)) working fine
subplot(p1,p2,p3, nrows=3, heights=c(0.91,0.04,0.05)) not working, not with any number smaller than 0.5.

BUT subplot(p1,p2,p3, nrows=3, heights=c(0.04, 0.92, 0.04)) working fine.

Is that expected behaviour? Or am I missing something here?

Thanks in advance and best regards

Hey @shosaco

there is some examples and discussion about the subplot() function and the correct uses of heights & widths here https://cpsievert.github.io/plotly_book/merging-plotly-objects.html, if that helps.

Thanks bcd, but the page (which I knew before) doesn’t go into that detail about the min/max value of the subplot heights. Strange thing is, p1, p2, and p3 are the exactly same plot, so it can’t be a but with the different y-ranges.