# Plotly, ggplot R modify legends

**URL:** <https://community.plotly.com/t/plotly-ggplot-r-modify-legends/30528>\
**Category:** Plotly R\
**Created:** [October 27, 2019, 8:20pm UTC](https://community.plotly.com/t/plotly-ggplot-r-modify-legends/30528 "2019-10-27T20:20:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kilo](https://avatars.discourse-cdn.com/v4/letter/k/0ea827/32.png) [@Kilo](https://community.plotly.com/u/Kilo)\
**Post date:** [October 27, 2019, 8:20pm UTC](https://community.plotly.com/t/plotly-ggplot-r-modify-legends/30528/1 "2019-10-27T20:20:30Z")

</div>

I have a ggplot graphic that I’d like to make interactive by passing it to ggplotly. When I do, plotly discards the ggplot legend and creates its own. With ggplot, I get a legend for each dimension (plotting character, color, etc.)

The ggplotly function produces what I think of as a “Cartesian Product Legend”. That is, there is one legend with a line for each color and shape combination. I’ve been Googling for the past day looking for a way to customize the legend, but with nothing helpful, I find myself here.

What am I missing?  
Thanks
