Skip to main content

All Questions

Tagged with
1 vote
1 answer
187 views

Combine catplot legend with other legends in seaborn

I want to combine multiple plot legends with a catplot legend and place the single result in the upper right. I also want to replace the labels on both. Examples - {"avg tip":"average&...
ciaran haines's user avatar
1 vote
1 answer
81 views

Choosing elements for a legend in Python

I am using py.plot to display the upper and lower bounds of confidence intervals (shaded in between). I would like to label each pair of bounds with the item they are measuring. However, Python seems ...
josephbags's user avatar
0 votes
1 answer
38 views

Custom colored lines in matplotlib but legend won't update

I am trying to plot lines out of a pandas dataframe, a pivot table of my data. There's 12 lines, one for each month of the year, and I don't want any duplicate colors. So I decided to set the colors ...
user21551428's user avatar
0 votes
1 answer
278 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
0 votes
2 answers
148 views

How can I insert png symbol into web map legend with folium-python 3

This code is part of other big code that generate a web map with folium module: legend_html = ''' <div style="position: fixed; bottom: 40px; left: 50px; width: 100px; height: 110px;...
newGIS's user avatar
  • 618
0 votes
1 answer
172 views

Adjust spacing between 2 markers of same line displayed in the legend of matplotlib plot

I am plotting 2 markers of the same line using the following code and I want to adjust the spacing between two markers in the legend. Code : ref. import matplotlib.pyplot as plt from matplotlib....
Natasha's user avatar
  • 1,421
0 votes
1 answer
60 views

Unable to visualize legend correctly in matplotlib

I am trying to visualize this graph with a lineplot, but the legend is not working correctly as you can see in the image below. The problems are three: two rectangles appear in the second and fourth ...
Francis's user avatar
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
1 vote
0 answers
938 views

Legend in an image generated by OpenCV (Python)

I'm plotting an image with the following code: cv2.imshow('',I) cv2.circle(I,tuple(xy),radius=1,c=(255,0,0),thickness=1) cv2.circle(I,tuple(uv),radius=1,c=(0,0,255),thickness=1) Is it possible to add ...
yonatan's user avatar
  • 133
0 votes
1 answer
600 views

GeoPandas | Legend not showing

Goal: Show legend I've set legend=True and no difference was made. for i in list(range(NUM_SLIDES)): d = {'col1': ['Foo', 'Bar', 'Sue'], 'geometry': [foo[i], bar[i], sue[i]]} gdf = gpd....
DanielBell99's user avatar
  • 1,521
0 votes
0 answers
208 views

How to map colors from multiple matplotlib subplot pie charts to a single figure legend

So I have been trying to get a legend working for a figure with multiple subplots that contain pie charts. The pie charts can contain any number of manufactures from a set list of manufacturers, but ...
Kgrover3's user avatar
2 votes
1 answer
454 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
  • 151
0 votes
2 answers
687 views

Matplotlib: display legend keys for lines as patches by default

For background, see the legend guide. I want to display legend keys for Line2D objects as Patches (with the same color and label), by default. What is the cleanest way to do this? I tried using ...
user76284's user avatar
  • 1,329
2 votes
1 answer
322 views

Add legend to mplot3d

For the 3D plot given here (thanks to Redox for his elegant solution posted here): how to go about adding the legend? I tried ax.legend() but got the message No artists with labels found to put in ...
Joe's user avatar
  • 367
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

15 30 50 per page
1
2 3 4 5
7