Skip to main content

All Questions

Tagged with
0 votes
1 answer
293 views

Legend doesn't show up in Plotly Express line subplots

There are several answers for showing the legend if you're using plotly.graph_objs. I'm only using plotly_express though, and can't get the legend to show up when using several subplots. I have the ...
Jakob's user avatar
  • 843
1 vote
1 answer
5k views

How to change the size of legend box in Plotly?

It is my code below: import plotly.graph_objects as go fig = go.Figure() for i in range(100): fig.add_trace(go.Scatter( x=[1,2], y=[1,2], name = f'{i}'*20, ...
ChienHua's user avatar
2 votes
1 answer
457 views

Need legend to communicate color for plotly graph go.Heatmap

I'm having a bit of trouble trying to figure out how to have the legend indicate color for my plotly graph objects heatmap. The legend only needs to communicate the graph colors and what they mean. ...
IDK's user avatar
  • 161
1 vote
1 answer
1k views

Plotly Custom Legend

I have a plotly plot which looks like this: The Code I am using is below: fig = make_subplots(specs=[[{"secondary_y": True}]]) fig.add_trace(go.Scatter( x = pf['Timestamp'], y = pf['Price_A'...
Imran's user avatar
  • 71
1 vote
1 answer
1k views

Plotly - clicking on legend items - how to make an initial setting?

When someone clicks on a legend item, it becomes grey, and the data disappears, for instance, here. It is possible to set that an item from a legend will be grey after opening the .HTML output and ...
Elena Greg's user avatar
  • 1,125
2 votes
1 answer
724 views

Plotly: group trace in legend and removing horizontal labels

I'm using Plotly to produce a similar graph from https://plotly.com/python/horizontal-bar-charts/, section "Color Palette for Bar Chart". Here's the code, based on the reference link, but ...
user188439's user avatar
0 votes
1 answer
628 views

Plotly legends on subplot position

I would like to put legends on subplot position. Is there any solution? It will be great if you can provide any type of suggestions. You can find the code here: https://github.com/sjshtura/EWL-DUE/...
Advut's user avatar
  • 117
18 votes
1 answer
29k views

Sharing same legends for subplots in plotly

I've two plots created in the same figure using subplots in plotly. import plotly.graph_objects as go import numpy as np import pandas as pd from plotly.subplots import make_subplots df = pd....
Natasha's user avatar
  • 1,431
1 vote
0 answers
94 views

Legend for marker size

I'm trying to but legend for marker size in Sccater plot there is some plot to describe what I want ( See Prediction Cost on the right ) Plot With Legend for marker size I did all what I want ...
Abdulwahabdev's user avatar
10 votes
2 answers
31k views

How to position legends inside a plot in Plotly

I have got this code from Plotly page. I need to make the background transparent and the axis highlighted. And also the legends positioned inside the plot. import plotly.graph_objects as go fig = go....
Leolime's user avatar
  • 317
33 votes
3 answers
49k views

Customizing the order of legends in plotly

I am trying to customize the order of legends while plotting stacked bar plots in plotly,python. data = [ go.Bar( y=df['sid'], # assign x as the dataframe column 'x' ...
Natasha's user avatar
  • 1,431