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.
legend
5,165
questions
1
vote
1
answer
50
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 ...
0
votes
0
answers
6
views
Can I have a legend for a data point as well as a legend for a grouped barplot in one graph
clustered barplot
I have added a legend to show the bars in a barplot, but I cannot figure out how to add the data point (+) to the legend. I want the data points that are + to be labeled in the ...
0
votes
0
answers
23
views
Line2D multiple colors in legend [duplicate]
I want to create a custom legend. Here, in the example, I create two lines. But for this line, which now is blue, I would like it to be in multiple colors: blue, green, and red.
Here is a minimum ...
0
votes
1
answer
45
views
how to have a legend for size of geom_points() and also set the size of the dots themselves?
I am trying to plot a sort of bubble plot but i am unable to set the size of the dots and have a legend explaining how the sizing works.
These are two examples which combined give me the expected ...
0
votes
0
answers
13
views
Matplotlib not changing legend labels for a plot in python package pyAT
So I am attempting to use a python interface of Accelerator Toolbox (pyAT: link here) to simulate the path of a few particles through an energy spectrometer. From this interface, I've utilized a ...
0
votes
0
answers
72
views
Left padding on right positioning legend in react-chartjs-2 line chart
I am using react-chartjs-2 line chart and assign legend position to right side but graph and legend does not containing the space. I want to provide left padding to my legend which create the space ...
0
votes
1
answer
19
views
ggplot manually adjusting attributes
I am trying to change the legend on this plot in ggplot. I want it to have both the appropriate linetype and color in the one legend. However, I would be satisfied if I could just fix the linetype ...
1
vote
1
answer
120
views
how to change size of symbol in ggplot2 when size, shape, and color are set through geom_point?
The problem i am having is surely trivial, and yet i am unable to solve it. What i need is to have my own shape, colour, and size for the geom_point(). However, if i set it, the size of the symbols in ...
2
votes
0
answers
47
views
Add p-value breaks to a gene oncology dot plot [closed]
I am so close to finishing up a gene oncology-gene ratio figure for a lab assignment, but I am struggling with adjusting my p-value breaks. I'd like to have control to having p-value range from 0.001 ...
0
votes
0
answers
33
views
Inserting legend in a Matplotlib/Geopandas Map
I've created a incidence map for a city, but now i need to manipulate the legend ( decrease its size, put it bellow the map/graph, insert labels). i've used a json file to plot the territory. Here's ...
0
votes
0
answers
30
views
ECharts confidence bands in legend as one item
I counstructed ECharts confidence bands around the main series, similar to example. However, in the example there is no legend.
I use legend and I want to show main data as one legend item and ...
0
votes
0
answers
41
views
R's plotly ggplotly removing legend from a geom_point
I'm generating a simple geom_point plot with R ggplot2:
library(dplyr)
library(ggplot2)
set.seed(1)
df <- matrix(runif(16, 0, 10), nrow = 4, ncol = 4, dimnames = list(paste0("R", 1:4), ...
1
vote
2
answers
42
views
Separate Legend Entries for Individual Outlined Overlapping Bars
I am creating a ggplot with multiple overlapping bar plots. The first underlying bar is filled with color and then I overlay one more set of bars with just an outline to show sub-components. I would ...
0
votes
1
answer
78
views
How to show values next to bars in tornado chart using ggplot in R [closed]
I have this table (T_Tornado_Total_EM_HM_sort):
And these are the lines that I used to make the tornado chart:
ggplot(T_Tornado_Total_EM_HM_sort, aes(Tipovi_troškova, RSD, fill=Populacija)) +
...
0
votes
0
answers
28
views
ggplot legend in R not recognising aesthetic changes for label category with no data points
Consider the following image:
Although the underlying dataset does not contain values below 0.1 degrees Celsius, I want to and still can force the legend to display the label and box for 'Below 0.1', ...
1
vote
1
answer
61
views
How to make pyplot Hatches look pretty in the legend
I have a problem and struggle to find a solution, or phrase the question for a search engine.
I have many python plots where i use hatches to show exclusions from constraints (so some hatches are not ...
1
vote
0
answers
31
views
Removing Duplicate Legend Entries using VBA
This code is to remove repeat legend entries. It will work as long as there isn't any series on the 2nd Y axis. As then the Series collection order and the LegendEntries order are different. I would ...
0
votes
0
answers
46
views
Is there a way to move the legend in a trackViewer lollipopPlot and/or change its orientation?
Is there any way to alter the position or orientation of a legend in a trackViewer lollipopPlot (or fudge something that performs the same function), so that it's on the side of the plot and directly ...
0
votes
1
answer
37
views
ggplot2 - how to keep the legend items with the same size, when geom_segment() has different sizes? [duplicate]
I'm plotting several segments as once using ggplot2, with two different sizes.
An example of what I want to do is provided in one of the answers here. Here's the example they provide:
ggplot2::ggplot()...
0
votes
3
answers
63
views
Having different shapes of points for each line and making them shown on the legends
My goal is to make the graph look something like this My Goal. The problem I'm having is that ggplot won't let me use more than 6 kinds of shapes for the points, so my graph looks something like this ...
0
votes
2
answers
37
views
Overlapping legend of a line plot
I want to show each line as having a different color and shape, and that should be reflected on the legend. Basically, it should look something like this My Goal.
I could make the color and point ...
1
vote
0
answers
35
views
How to align legend elements in the middle when they are on two rows using ggplot2?
In the MWE below, the caption appears separated into two rows. I want the item corresponding to gear 5 to be aligned in the middle in relation to gears 3 and 4 above it.
How can I do this?
library(...
0
votes
1
answer
98
views
How do I add a legend to ggplot with two scatter plots (geom_point() )
I have a table I read into R to plot with ggplots. I need to plot two sets of data points and also use an ifelse condition to be able to show specific genes.
I would like to show a legend to the plot, ...
1
vote
1
answer
106
views
How to customize the legend order for a 3D scatter plot?
I'm trying to generate a 3D scatter plot and the shapes of markers correspond to 'Treatment' (IC, IT, YS), whilst, the colors correspond to 'Time' (0, 2, 4, 6, 12, 24, 48, 72). Everything went well ...
1
vote
1
answer
64
views
Why doesn't sns.barplot legend show all values?
I have the following graph. Why does the last graph legend not contain all labels? It should contain these values:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 20, 21]
Code:
# select only this year
...
1
vote
1
answer
76
views
Title and legend adjustment with `grid.arrange`
I have 6 different plots in R that I want to arrange in one plot with grid.arrange. They share the same legend, but whenever I want to put a common legend, the sizes of the plots are adjusted ...
0
votes
0
answers
37
views
Modal-Opener Inside fieldset/legend element
On the Shopify product-page I want to display a Size-Chart.
Unfortunately I have way to less experience to get the text inside the element.
This is the code which styles the elements like size and ...
0
votes
0
answers
43
views
Excel chart legend does not list all values
I'm using Excel for Microsoft 365 Version 2402 (latest as of March 2024), and I have the following table and associated chart:
The blue triangle in the center of the chart is for the value 80. In the ...
0
votes
1
answer
263
views
How to add spacing between Legend and Chart in Recharts with absolute positioning?
I'm using Recharts for the first time in my React project
I've positioned the legend of my BarChart component to the top right corner.
However, I'm struggling to add spacing between the legend and the ...
0
votes
0
answers
26
views
Entrywidth argument not working in R plotly
I am trying to make an interactive plot with the plotly package. The legend needs to be next to the image and have a certain width. I now have the issue that the default appears to be that the legend ...