Skip to main content

All Questions

Tagged with
0 votes
1 answer
328 views

How to add two different labels to legend for an overlap plot using matplotlib in python?

Okay this might be easy even I search on web but could not get it. Basically i want to add the two different labels to my plot and this is my line of code for that plt.plot(x[:,1],y,'ro',x[:,1],...
Anil Sarode's user avatar
2 votes
3 answers
1k views

Python matplolib legend how to reduce distance between frame left edge and markers

As question suggests, I'm trying to reduce the distance between the left edge of the legend frame and the markers. In figure there is the current plot. I would like to find a way to: keeping the ...
Giuseppe Angora's user avatar
0 votes
1 answer
157 views

Solution for scatter legend of subplots

I have a problem i can´t handle. I tried several things but its not working. Or at least I am to dumb to get the solution idk. T create subplots with a for loop and every time create it with data ...
Hendrx's user avatar
  • 5
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
3 votes
1 answer
4k views

Suppress WARNING:matplotlib.legend:No handles with labels found to put in legend

Sorry if this has been asked before but all the answers I found didn't work for me. I'm looking for a way to suppress this warning. The context is that I wrote a function that creates a lot of plots ...
rhedak's user avatar
  • 409
0 votes
1 answer
177 views

Creating a pie chart with unknown number of pies

I am trying to create function which creates a pie chart. This pie chart can have n number of pies that's why I am taking function arguments as *args. I found a way to create colors according to the ...
Anudocs's user avatar
  • 686
0 votes
1 answer
26 views

How I can make the legend of a plot, shows me each variable Im working on?

Im making an overlay plot but when i add a legend and the legend shows in the graph it only shows one day that repeats several times like this imagen = plt.figure(figsize=(25,10)) for day in [1,2,3,...
dchaco95's user avatar
0 votes
2 answers
488 views

Set the same legend for multiple charts

I would like to have a common legend at the end of my "multi chart area". "weeks_df_list" is a pandas DataFrame. my code is: #https://stackoverflow.com/questions/41625077/python-pandas-split-a-...
Je Je's user avatar
  • 562
1 vote
1 answer
320 views

How to set the same legend (Label) to different scatter points in my plot?

Need some guidance handling legends with matplotlib/pylab. for xe, ye in zip(dist, liston): plt.scatter([xe] * len(ye), ye, s = 200, color = 'darkseagreen') where: dist = [2.0, 4.0, 6.0, 8.0, ...
itsaMeMathi0x's user avatar
0 votes
1 answer
511 views

plt.legend() blocks matplotlib to display plot

Without plt.legend() called, the plot gets displayed. With it, I just get: <matplotlib.legend.Legend at 0x1189a404c50> I'm working in JupyterLab, Python 3, Anaconda I do not understand what is ...
Aleksandar Ciric's user avatar
0 votes
0 answers
202 views

How do you add a legend to a 3D scatter plot in matplotlib when using a DataFrame?

I am trying to create a legend for my 3D plot. I do not completely understand the use of a handle when it comes to making a legend. I have followed two previously posted questions Matplotlib: ...
Pythoner's user avatar
  • 572
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
0 votes
2 answers
2k views

How to stop matplotlib legend text overlapping?

I am using python-3.x and I would like to find a way to stop legend in the right of the line overlapping as you can see from the following image: I am trying to make it look similar to the following ...
azeez's user avatar
  • 497
0 votes
1 answer
1k views

Main figure legend outside of subplots

I have a number of subplots within a single figure. Each figure plots multiple lines that represent the same thing (represented by color) but in different situations (different subplots). I would like ...
js16's user avatar
  • 63
1 vote
1 answer
196 views

Multiple marks on a legend

I created a legend for some marks that I plotted in an image from satellite data. I can't figure out how to have multiple marks for the different places I'm ploting. import matplotlib.patches as ...
Anthony Bernal Ayala's user avatar

15 30 50 per page
1 2 3
4
5
7