Skip to main content

All Questions

Tagged with
1 vote
1 answer
45 views

How to add legend of plotted line in a box plot?

I have plotted a set of data in a boxplot, and I have added a line in the plot. I want to have the labels of the median and mean in the legend, and I have got it. However, I'm also trying to add the ...
lolloa's user avatar
  • 27
0 votes
0 answers
359 views

How do i update a matplotlib plot legend/label dynamically? [duplicate]

I want to update the "label"/legend parameter dynamically. It will be an integer variable coming from a function. I want the label to change every time that value in the function changes. so ...
hghebrem's user avatar
0 votes
0 answers
27 views

How to assign labels and color code to data manually in scatter plot [duplicate]

I've three 1-D arrays, BT1=np.random.uniform(180,300,size=[1,100]) #x BT2=np.random.uniform(180,300,size=[1,100]) #y color_code=np.random.choice(0,1,size-[1,100]) #color code fig,ax=plt.subplots() ...
Pixel_Bear's user avatar
-1 votes
1 answer
57 views

error "No handles with labels found to put in legend."

x = datasetB1780v1["Settlement_Period"] y1 = datasetB1780v1["Imbalance_Quantity_(MWh)"] y2 = datasetB1780v1["Insufficient_balance_Price_Amount"] y3 = datasetB1780v1["...
Jaime Romero Mijancos's user avatar
0 votes
1 answer
513 views

Adjusting global legend (labels) of a plot with subplots (which currently overlaps with the plot) - matplotlib, python

I am trying to add a global legend to a plot, the code below does that but the legend then overlaps with the given plot (I'll add the plot below). Is there a way to adjust the legends? The other ...
Saransh's user avatar
  • 75
-1 votes
1 answer
179 views

lables for plots of multiple y value for one x value

I am plotting several y values for one x value at a time using this method: x = [0.3, 0.1, 0.4, 0.65, 0.85, 0.9, 0.125] y = [1,2,3,4,5,6,7] plt.figure() for xe, ye in zip(x, y): plt.scatter([xe] * ...
alex's user avatar
  • 41
0 votes
1 answer
986 views

Formatting a legend with numerical values as labels in python

So I need to format a legend such that the numerical values it contains are expressed in standard form. The code is reproduced below. Note that the legend labels rely on the value of k which is ...
chelseabej1998's user avatar
0 votes
2 answers
706 views

How can I skip repeated lablels in the legend when I plot using a for-loop?

import pandas as pd import matplotlib.pyplot as plt from random import random DF = {"A":[(random(),random()),(random(),random())], "B":[(random(),random()),(random(),random()...
Paw in Data's user avatar
  • 1,432
0 votes
1 answer
235 views

Matplotlib plot does not show legend

I want to quickly plot a function varying one of its parameters and with a legend showing the value of this parameter: def supergaussian1d(x, x0, Imax, FWHM, n): return Imax * np.exp(-4 * np.log(2)...
david's user avatar
  • 201
9 votes
1 answer
603 views

How to set a title above each marker which represents a same label

I have a first version of legend in the following plot : with the following code : # Plot and save : kmax = 0.3 p11, = plt.plot([0], marker='None', linestyle='None', label='$k_{max} = ...
user avatar
0 votes
1 answer
4k views

Change the legend enteries by column values in matplotlib

I'm struggling a lot with changing the labels in the legend in matplotlib charts. This is my graph: I would like to change the legend so the labels will be based on the values in column called "name",...
Reut's user avatar
  • 1,582
1 vote
1 answer
183 views

Show edges and faces of markers in legend

I have the attached plot, and I like the symbols as plotted with ax.errorbar('mjd', 'aperMag3Ab', label='', fmt='o', color='k', ms=ms*1.4) ax.errorbar('mjd', 'aperMag3Ab', label='WFCAM Y', ...
npross's user avatar
  • 1,846
1 vote
2 answers
4k views

Python Windrose Legend Labels

I am trying to take full control of the legend in the Windrose; the legend is controlled by the bins, which can be called using the ax.info['bins']. However, I want to change the name of the bin ...
Aly Abdelaziz's user avatar
-1 votes
1 answer
247 views

Number of legend entries equals the size of data set

I'm plotting many sets of data in a for loop. The number of sets and size of sets don't have any problems plotting. When I try to add a legend, things get interesting. I get a legend, but I only get ...
Troy Cracroft's user avatar
1 vote
1 answer
551 views

Set up labels and legend using plt.subplots()

I am using plt.sublot to create a figure with 12 subplots that share the same data so I want to show the labels and legend for one of them. I am accessing and plotting the data from a dictionary that ...
Karina Gutierrez's user avatar

15 30 50 per page