[R] plotly example that highlights a line

Roy Mendelssohn - NOAA Federal roy.mendelssohn at noaa.gov
Tue Feb 28 22:16:03 CET 2017

Hi All:

In searching online,  I have found examples of using plotly with ggplot2 graphics,  say using geom_line,  where there are multiple lines and by selecting the "factor" in the legend makes the particular line disappear or reappear  (see https://plot.ly/ggplot2/).  I am wondering if anyone's an example or knows how to set it up, so that instead if I click on the factor in the legend it highlights the line, and hen unhighlights if i select again

Thanks for any help.


"The contents of this message do not reflect any position of the U.S. Government or NOAA."
Roy Mendelssohn
Supervisory Operations Research Analyst
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.

More information about the R-help mailing list