Skip to main content

All Questions

3 votes
0 answers
249 views

Plotly legend marker opacity and spacing

Is it possible to access the symbols in a legend? I would like to set their opacity to a higher value than the opacity of my trace markers, and ideally I would like to make them tighter (in the sense ...
Tim Kirkwood's user avatar
0 votes
1 answer
774 views

Scatter plot marker size and legend, markers = area, but how do I get legend labels = diameter?

I have been a long time viewer of your questions and answers as I learn python. I have hit a snag in making some figures for a project I am working on. I am making a figure detailing properties of ...
Richard Cyburt's user avatar
1 vote
2 answers
540 views

Make two markers share the same labels and simultaneously keep the black edge of patch in legend

How should I modify my following code to make two markers share the same labels and simultaneously keep the black edge of patch in legend? Here are code (I have plotted the bars twice to decouple the ...
lhhhhhhh's user avatar
2 votes
1 answer
2k views

How to change the edge color of markers (patches) in Matplotlib legend?

I know the hatch color follows the edge color when plot bars, so I have plotted the bars twice to decouple the hatch color and edge color. Although this method works in bars, I don't know how to ...
lhhhhhhh's user avatar
0 votes
0 answers
667 views

Seaborn scatterplot with varying marker sizes and informative legend

I'm trying to create a scatterplot in which the size of the markers vary according to the values of specific columns in the dataframe. This can be done with size and the size of the markers may be ...
flucoe's user avatar
  • 273
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
226 views

While setting the size of the marker the legend does not show the marker with variable size

the legend in my plot does not show the marker with variable size, but only the one without variable size. I can not share my dataset. (look the image) Hided marker in the legend plot, and the code ...
Alberto Mazzoncini's user avatar
39 votes
2 answers
55k views

How to make a colored markers legend from scratch

In Matplotlib, I'm trying to make a legend with colored "markers" like this one : this one has been made using the scatter function, but is not adapted to my plot. I'd like to produce a ...
Covich's user avatar
  • 2,764
3 votes
1 answer
197 views

Legend markers appear several times

I need to plot data sites on a map. For example, survey "DEPROAS" has five stations so, I need to plot'em and insert it in legend guide. But, when I do this, instead of plotting just once (...
vicemagui's user avatar
  • 153
3 votes
2 answers
1k views

Legend with Different Number and Color of Markers per Handle

Given the following: import pandas as pd import matplotlib.pyplot as plt d=pd.DataFrame({'category':['a','a','a','b','b','b'], 'year':[1,2,1,2,1,2], 'x':[2,4,5,1,2,3], ...
Dance Party2's user avatar
  • 7,416
5 votes
1 answer
4k views

Matplotlib legend: how to assign multiple scatterpoints values

I'm using the matplotlib library in python to generate publication-quality xy scatter plots. I ran into a problem regarding the markers in the legend. I'm plotting 2 different xy-scatter series; one ...
S Kulk's user avatar
  • 193