Open ratnanil opened 6 years ago
Stéphane Laurent posted a working answer to this problem on Stackoverflow: https://stackoverflow.com/a/51880088/4139249
small_multiples <- subplot(plots,nrows = 5) %>%
layout(scene = list(aspectration=list(x=1,y=1))) %>%
hide_legend()
Feel free to close this issue.
subplot()
doesn't (yet) respect scaleanchor
, but I think it could
I would like to create small multiples with a fixed aspect ratio. However, there seems to be a but somewhere and only some plots retain the correct aspect ratio. From what I gathered, setting a fixed aspect ratio with plotly is done as follows:
layout(yaxis = list(scaleanchor = "x"))
Consider the follwing example:
If I plot
small_mulitples
, only the first plot (row 1, column 1) has an aspect ratio of 1. The other have an arbitrary aspect ratio.Here's the link to the interactive version of this plot: https://plot.ly/~rata_zhaw/1/
Interestingly, if I choose the option
shareX = T
insubplot()
, the entire first column has the correct aspect ratio. Nothing changes if I chooseshareY = T
And here's the link to the interactive version of the second plot: https://plot.ly/~rata_zhaw/3/
If I plot any of the plots individually, the aspect ratio is correct: