diff --git a/python/legend.md b/python/legend.md index 1e6d7d58f..c7aa70e29 100644 --- a/python/legend.md +++ b/python/legend.md @@ -217,7 +217,32 @@ fig.update_layout( fig.show() ``` +### Size of Legend Items +In this example [itemsizing](https://plot.ly/python/reference/#layout-legend-itemsizing) attribute determines the legend items symbols remain constant, regardless of how tiny/huge the bubbles would be in the graph. +```python +import plotly.graph_objects as go + +fig = go.Figure() + +fig.add_trace(go.Scatter( + x=[1, 2, 3, 4, 5], + y=[1, 2, 3, 4, 5], + mode='markers', + marker={'size':10} +)) + +fig.add_trace(go.Scatter( + x=[1, 2, 3, 4, 5], + y=[5, 4, 3, 2, 1], + mode='markers', + marker={'size':100} +)) + +fig.update_layout(legend= {'itemsizing': 'constant'}) + +fig.show() +``` #### Grouped Legend ```python