# Shared legend for subplots in Plotly

**URL:** <https://discourse.julialang.org/t/shared-legend-for-subplots-in-plotly/110497>\
**Category:** Visualization\
**Tags:** plotting, plutoplotly\
**Created:** [February 21, 2024, 4:58am UTC](https://discourse.julialang.org/t/shared-legend-for-subplots-in-plotly/110497 "2024-02-21T04:58:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pex/32/49986_2.png) [@PeX](https://discourse.julialang.org/u/PeX)\
**Post date:** [February 21, 2024, 4:58am UTC](https://discourse.julialang.org/t/shared-legend-for-subplots-in-plotly/110497/1 "2024-02-21T04:58:12Z")

</div>

I’ve seen variations of this question, but nothing fits my case exactly so I’m trying.:  
I want to create three subplots in Plotly that share the same legend, I use the following code:

```julia
p = [p_1; p_2; p_3]
relayout!(p, height=500, width=900, title_text="Multiple Subplots")
p

```

Where each plot is a bar plot. Is there a way to create all the subplots with the same color scheme and share the same legend?

Thank you!
