Reputation: 887
I have created a subplot with plotly.JS , x axis is shared for each graph as given in the below picture.
I want to show the x axis values for all graphs in the subplot instead for showing it only for graph at bottom. I achieved this using anchor attribute, but the graphs are not aligned well. Look at the below picture, here 600 of graph2 is not positioned exactly to the other two graphs.
I want all the graph to share x axis as well as show the x axis values on each graph.
Upvotes: 4
Views: 1063
Reputation: 223
This is an old question but I spent a lot of time figuring it out, so hopefully it will still be useful. It turns out to be very doable just not using the grid
layout
.
Here's a pen that demonstrates it:
https://codepen.io/cerenoc/pen/wvVaYQj
The key parts here are:
domain
to shrink the plots a bit along y to leave room for x axis labelsmatches
to specify shared axesUpvotes: 0