All Questions
72
questions
0
votes
0
answers
7
views
How can I include two categories of label (colour coded and shapes) in a single legend for a single dataset using a matplotlib scatterplot?
I have a dataset, texts, that I want to display using a scatterplot. The texts represented in this dataset have different authors, and are written in different languages. I want to represent the ...
0
votes
0
answers
35
views
Add legend to scatter plot to differentiate colours, when there are multiple data types?
How do we add a scatter plot legend which signifies the different colors on python chart?
i.e. how do we turn chart 1 into chart 2
Chart with data types has legend missing
Chart without data types ...
0
votes
1
answer
77
views
creating a scatter legend size with range 0-100 no matter what the range of the data
I am having trouble with creating a matplotlib scatter plot with a legend showing the size diameter of points. The problem is with the scatter_plot.legend_elements function.
The problem is I want to ...
0
votes
1
answer
285
views
How to customize the color scatterplot legend handle [duplicate]
I have a seaborn scatterplot with datapoints distinguished by (1) color and (2) marker. This is the minimal code that generates the plot:
d = {'x': [1, 2, 3, 4], 'y': [2,4,6,8], 'Set': ["Set 1&...
-1
votes
3
answers
1k
views
How to create two different legends from multiple plot calls
I have to create a visualization where there are multiple line plots (trend lines/moving averages etc.), and multiple scatter charts.
I have successfully created all the charts in a single plot, ...
-1
votes
2
answers
157
views
How to add legend for a scatter plot with title and customized labels and position the legend in any way user wants?
I have created a scatter chart where I have values of a certain column ABC ranging from 0-10.
The points have 4 colours: light blue for values less than 2, blue for 2-4, orange for 4-6 and brown for 6 ...
1
vote
1
answer
149
views
Matplotlib scatterplot subplot legends overwrite one another
I have a scatterplot figure with subplots generated using a for loop. Within the figure, I am trying to create a single legend but each time a subplot and legend is rendered the legend is overwritten ...
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()
...
3
votes
1
answer
5k
views
Add two legends in the same plot
I've a x and y. Both are flattened 2D arrays. I've two similar arrays, one for determining the colour of datapoint, another for determining detection method ("transit" or "radial"),...
-1
votes
1
answer
297
views
Changing color and marker of dataset using seaborn jointplot
I want to add an additional variable to the plot listed below. At the moment I have a different colour of marker corresponding to a different metal. But for every metal, there is a different geometry, ...
0
votes
1
answer
290
views
automatic label and color in matplotlib scatter plot
I have a dataframe like this:
data =
sample time (h) Voltage
1 1 2.4
1 2 3
1 3 4
1 4 5.1
2 1 2.4
2 2 3.2
2 3 4.2
2 4 5.2
3 1 2.3
3 2 3.3
3 3 4.4
3 4 ...
0
votes
1
answer
630
views
Exclude hue-variable from legend
I struggle finding a way of properly displaying only the labels respective to the markers in a scatterplot. My code looks as follows:
fig, ax = plt.subplots(1,1)
plot_white = sns.scatterplot(data=...
0
votes
1
answer
271
views
How to scatter plot in different colors and add a legend
from the following df I have extracted the desired rows
**name** **event** **X** **Y**
peter run 20 50
peter jog 30 25
peter ...
0
votes
1
answer
197
views
Matplotlib scatterplot legend
This is a repeat of a common question, but I've spent 4 hours reading responses and I still can't make sense of them and my code throws errors or returns unexpected results.
This task is so simple ...
0
votes
1
answer
465
views
How can I create a legend for my scatter plot which matches the colours used in the plot?
I've created a scatter plot (actually two similar subplots) using matplotlib.pyplot which I'm using for stylometric text analysis. The code I'm using to make the plot is as follows:
import matplotlib....