I am trying to give hover info simultaneously on 4 subplots. One of them has 2 traces but trace2 is not being displayed unless I put xaxis:‘x’ instead of axis:‘x2’ on that trace. If I put it, the simultaneous hover on all 4 subplots doesn’t work and it duplicates zeroline. Could you help me please?
It’s a bit complicated to calculate how many axes you should configure, to start you should consider the following, in how many rows and columns are you going to distribute your subplots, in your case there are two rows and two columns so to start you need two “x” axes (xaxis) and two “y” axes (yaxis), from there the next thing is to see if the data in the graphs are in similar ranges, the values of the “x” axis in all the traces go from 0 to 2 therefore you don’t need to create another axis, in fact if you had distributed your subplots in a single column you would only have needed to configure one “x” axis but in the “y” axis you have different ranges of [-11,12], [-120,100], 2 x [-3200,2000] and [-1000,1200], 5 in total but if we move the last trace so that it shares the same axis that is repeated twice then we would have to configure 4 “y” axes instead of 5, but if you want to continue maintaining the position of the graph then there would be 5 “y” axes to configure.
But if you don’t want to rack your brains then create your own “x” and “y” axis for each subplot even if they have similar ranges.