Interactive Legends


Can anyone tell me if it is possible to create interactive legends on graphs in plotly? i.e., a drop-down menu on the chart that changes the chart display depending on the category that is selected. Any help would be greatly appreciated.

Updatemenus Matlab

Here’s an example:

See the corresponding MATLAB code:

Dropdowns menu are a new feature to plotly; so we haven’t had the chance to write a MATLAB tutorial for them. In the meantime, you might want to look at our python tutorial here:


That’s great. Thanks for your reply.


The .embed version of this still works. When I execute the linked Matlab code the plot opens as it should, but the dropdown selection results in an empty plot:
Related to the topic that I just posted - I cannot figure out how to get the updatemenus to work: Updatemenus Matlab


'found out how to get the Matlab version running. The args needs a curly brace instead of square, i.e. replace
‘args’, { {‘visible’, [true, true, true, true]} }
‘args’, { {‘visible’, {true, true, true, true}} }, …