All Questions
20
questions
0
votes
0
answers
34
views
Matplotlib legend position for graphs
x = ['TPhP', 'TPrP', 'THP', 'OEP', 'Aristophyll A', 'TETMP', 'DMDHP', 'THDPP', 'BDTDP']
plt.xticks(range(len(x)), x, rotation='vertical')
plt.ylim([-6, 12])
y1 = [-3.8681, -3.7851, -3.6178, -3....
0
votes
1
answer
91
views
Why is there multiple indentical entries in a legend when plotting with matplotlib? [duplicate]
I try to plot a list a of values with respect to time and I have two examples: one where Im plotting angular velocities and the other where Im plotting linear accelerations. For both graphs the code ...
-1
votes
1
answer
367
views
Use variables in legend handles
I want to graph multiple different bar charts and the colors in each graph will vary depending on the data being plotted. I would like to have a legend with handles (to accompany each set of data and ...
0
votes
1
answer
194
views
How to remove duplicates and move the legend list to outside of the graph concurrently?
I have seen many good questions questions and answers, but I am not sure how to combine two of them:
How to put the legend outside the plot
Duplicate items in legend in matplotlib?
These two ...
1
vote
1
answer
2k
views
How to remove a legend part of a seaborn facetgrid
In Matplotlib/seaborn I create a facetgrid with the relplot command where the data attribute use for therow parameter is also used for the style attribute. This leads to a legend with two parts. One ...
2
votes
1
answer
720
views
Is it possible to use matplotlib legend picker selecting legend text area not legend line?
I want to make a graph using matplotlib. I would like to add a picker function so I can find a code from this matplotlib URL: https://matplotlib.org/stable/gallery/event_handling/legend_picking.html
...
1
vote
0
answers
282
views
Matplotlib same LaTeX format for text and float-to-string part
I am trying to work on the legend of my graph:
As you can see that I used the dollar symbol for timestep to make it latex (I hope I am not wrong) but I am unable to get the same font/format for the ...
0
votes
1
answer
707
views
How do you add more than one element to a Matplotlib legend?
I can't seem to figure out how to add more than one element to the legend of my line graph. I've attached my graph here, and any help would be appreciated!
Here's my code:
fig1 = figure()
ax0 = ...
1
vote
1
answer
89
views
Putting two different entries under same label in a legend
I have plotted a graph with different data sets and trend lines. I was wondering if it was possible to have two different entries under the same label without the label appearing twice in the legend:
...
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....
1
vote
1
answer
1k
views
Matplotlib Axes legend shows only one label in barh
I have 15 barh subplots that looks like this:
I can't seem to get the legend working, so I'll see [2,3,4] as separate labels in the graph and in the legend.
I'm having trouble with making this work ...
3
votes
0
answers
8k
views
Python- Change legend position in plot [duplicate]
I want to change legend position because legend names a little bit longer(X Position according to ...) so that I want to put this name vertical (right side of graph or under the plot). I have three ...
6
votes
3
answers
10k
views
How do I change the size of the scatter markers in the legend?
I am basically plotting a scatter graph with matplotlib, however, I have varied each point by a radius.
When I use plt.legend() to show my legend, it looks like this......
Is there a command to ...
0
votes
1
answer
3k
views
Suppressing a MatPlotLib benign warning [duplicate]
I'm plotting a few different graphs, and I don't want to have a legend since I don't need it.
ax.scatter(x, y, ..., label='')
The above works just fine for me, but it sends a UserWarning out.
I ...
0
votes
1
answer
272
views
Legend is not working properly in Python
import matplotlib.pyplot as plt
import numpy as np
import xlrd
import xlwt
import pandas as pd
wb = xlrd.open_workbook('Scatter plot.xlsx')
sh1 = wb.sheet_by_name('T180')
sh2=wb....