I need to plot a data set with the same structure as in the Iris flower data set with Plotly.js. It should look like Mike Bostock's scatterplot matrix. While getting the effect shown in the link is pretty simple, I am having a problem with the legend - I want to be able to switch on/off whole series (such as specific species in the Iris flower example) simultaneously on all subplots by clicking the corresponding legend item. Currently, I am adding traces for each subplot separately, but this results in separate items for each subplot in the legend (16 x 3 instead of just 3, one for every species), so clicking on an item works only for one subplot at a time. Does Plotly.js give any way of solving this problem?
1 Answer
You can do so with the legendgroup trace attribute.
Here's an example: http://codepen.io/etpinard/pen/MKbqPB
1 Comment
Jossie Calderon
This works superbly for Python. Make sure to have separate
legendgroups for each distinct legend item!