✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.

Hover Events in MATLAB®

How to add custom hover effects to Python charts with JavaScript.


data = {...
  struct(...
    'x', { {'Bob Dylan', 'The Beatles', 'David Bowie', 'Randy Newman', 'The Rolling Stones', 'Madonna', 'Frank Sinatra', 'The Beach Boys', 'Marvin Gaye', 'Prince', 'The Kinks', 'Elvis Presley', 'Tom Waits', 'U2', 'The Clash', 'Johnny Cash', 'Kate Bush', 'The Supremes', 'The Smiths', 'Al Green', 'Pulp', 'Chuck Berry', 'Elvis Costello and the Attractions', 'Neil Young', 'Stevie Wonder', 'Ray Charles', 'The Pogues', 'Grace Jones', 'Bill Withers', 'The Who', 'Paul Simon', 'Roy Orbison', 'Arctic Monkeys', 'Bruce Springsteen', 'The Police', 'Rod Stewart', 'Steve Earle'} }, ...
    'y', [24, 19, 9, 8, 8, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], ...
    'name', 'Number of songs per artist', ...
    'marker', struct('color', '#2ca02c'), ...
    'type', 'bar')...
};
layout = struct(...
    'title', 'Number of songs listed in the Guardians<br><b>Top 1,000 Songs to Hear Before You Die</b> per artist with 4 or more songs', ...
    'font', struct(...
      'family', 'Georgia, serif', ...
      'color', '#635F5D'), ...
    'plot_bgcolor', '#EFECEA');
response = plotly(data, struct('layout', layout));
plot_url = response.url