Skip to main content

Questions tagged [legend]

A graph legend is commonly used when plotting several sets of data within the same diagram. The legend associates each plot with its corresponding data.

1,296 questions with no upvoted or accepted answers
3 votes
1 answer
689 views

R ggplot2 overlapping histogram, adding in legend for overlapping part

I have a histogram that is plotting 2 different groups with some overlap between them. I have been able to manually color the groups and a legend is generated for each group, however I am asking how ...
Cyph's user avatar
  • 81
3 votes
0 answers
331 views

How to get R Plotly pie charts to show legends based on values other than labels

I am plotting a pie chart with R plotly which I want to slice the pie based on column A and color each slice based on column B. I want each slice to show label based on column A, and I want the ...
Bernard's user avatar
  • 73
3 votes
0 answers
180 views

How do I change de size of the legend with matplotlib? and identify the states on my map

I have made this code for an activity, I am a beginner in python. But when I plot, the legend only shows the first letter of my legend. Also, this map shows a group of states and I would like to know ...
Daniele Ingredy's user avatar
3 votes
0 answers
152 views

Create a legend for user-defined marker_colors in Plotly

I´ve set manually colors for some bars of a bar plot (one which corresponds to the max value and another one - to the value I´d like to draw attention to). Here´s a sample of the df ranking = df['...
Ksenia Kustanovich's user avatar
3 votes
0 answers
464 views

Change title legend position using guides() without breaking the legend into discrete numbers

I was wondering if you can help me out with a (probably silly) problem with my code that is driving me nuts. I'm using R and my problems are with the package sf + ggplot2. Is there anyone out there ...
bmora's user avatar
  • 77
3 votes
0 answers
286 views

Seaborn scatterplot shows wrong value in legend despite setting a max value in hue_norm

I want to have the seaborn scatterplot legend show different colours from 0 to 130, but instead it shows 50, 100 and 150. The max value in my dataset is 130, so it is very confusing to the reader to ...
nielsen's user avatar
  • 383
3 votes
0 answers
980 views

Colorbar too big - Python Matplotlib

I want to plot a geodataframe from Buenos Aires, the proportion of poor houses. There's the code: import pandas as pd import geopandas as gpd import matplotlib.pyplot as plt caba=gpd.read_file('https:...
Tomás's user avatar
  • 31
3 votes
0 answers
256 views

Victory Chart Custom Legend in react

I want to change icon like but in documentation can't find custom legend
Armen Asaduryan's user avatar
3 votes
0 answers
2k views

Theme(position.legend="none") doesn't work with coord_flip()

I want to have a horizontal bar chart, but without legend. When I run the script below without coord_flip(), no legend shows. But when I run it with the coord_flip() argument, the legend appaers. I ...
SHW's user avatar
  • 491
3 votes
0 answers
315 views

Why legend does not appear outside plot?

I run code from this answer How to put the legend out of the plot in PyCharm in console (Anaconda environment) and it didn't produced right output I recreated a conda env, but it still does not work. ...
Maciej Dzieżyc's user avatar
3 votes
1 answer
1k views

breaks and values not matching up in plot when using scale_color_manual in ggplot2

I am trying to graph multiple graphs using the same colors (values) for each group I am plotting using scale_color_manual. It seems to work well for many of the graphs, but not all and I cannot seem ...
Megan Ladds's user avatar
3 votes
0 answers
2k views

Show only top 5 values in legend for Pie Chart (Am4 charts)

I have a pie chart with legends made using Am4 charts but I need to display only the top 5 legend values. I wrote the following code: var chart = am4core.create("chartdiv2", am4charts.PieChart); ...
Thanatos's user avatar
  • 292
3 votes
0 answers
3k views

How to change legend scale - folium choropleth map

I have some sort of error with the scale of the legend on my choropleth map in folium. I have tried to use the bin size to change it but can't work out what I am doing wrong. no mater what numbers i ...
Sam's user avatar
  • 81
3 votes
0 answers
2k views

ggplot2: Stacked bar and legend on the top

I am trying to plot my data using stacked bar plot. I want to put the legend on the top of the plot for aesthetics reasons. However, when I do so the order of the does not match the order of the ...
degopwn's user avatar
  • 517
3 votes
0 answers
763 views

Scatter marker and boxplot symbol combined to a single legend key

I want to plot two datasets, the first representing the stage A of a product in development and the second the stage B respectively, using a scatter and boxplot. I used matplotlib's scatter and ...
Hannes's user avatar
  • 73

15 30 50 per page
1 2
3
4 5
87