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,162
questions
0
votes
1
answer
39
views
How to prevent hiding plotly chart bar on chart legend click
How to prevent hiding plotly chart bar on chart legend click in an angular application.
<plotly-plot
[divId]="graph.selectedGraph.name"
[data]="graph.selectedGraph....
1
vote
0
answers
30
views
Why is the coding for legend on my barplot not working after update?
I updated Rstudio and suddenly none of my legends are working on my barplots. It's my first time asking for help on here, so hopefully I am providing the info needed to get answers? Coding is below. ...
0
votes
1
answer
63
views
How to center legend text in ggplot
I have a plot that looks like this:
I used these data and code to produce it:
structure(list(zone = c("Zone 1", "Zone 2", "Zone 3", "Zone 4",
"Zone 5&...
2
votes
2
answers
148
views
Specify which legend to keep in wrap_plots
I'm looking to combine multiple graphs generated from different functions into a single display. Specifically, I want to only keep the legend of the first graph in the wrap.
Here is a minimal version ...
0
votes
1
answer
43
views
Legend is not reflecting symbol plotted in ggplot2
I have a dataframe that looks like this:
structure(list(season = c("Fall", "Spring", "Summer", "Winter"
), effort = c(2559.85453311966, 4741.60449074074, 2014....
0
votes
1
answer
31
views
How to reverse legend order without affecting bar order in Plotly R? [duplicate]
I am creating a stacked bar chart using Plotly in R, and the order of the items in the legend is the reverse of the order that I want.
library(dplyr)
library(plotly)
library(forcats)
set.seed(1)
df &...
0
votes
0
answers
12
views
Visnetwork not displaying visLegend properly
I am using the package VisNetwork and one of the attributes of the nodes contains 9 different possibilities, as follows. This is just a minimal example. In my real dataset, the column "family&...
1
vote
1
answer
119
views
Order of ggplot ignoring order of legends
With the following data, I am trying to create a plot as shown, but the order of legends as: mgCST Group, CST Group, Treatment Status. However, ggplot is ignoring all attempts to order the legends
...
-1
votes
1
answer
38
views
Add horizontal lines with according color and legend to ggplot using R
I want to add horizontal lines so that the lines have y-intercept of period and colors according to their obj_name, ie the same colors as the line plot for each object. I succeeded in putting in these ...
1
vote
1
answer
32
views
Multiple columns in legend using ggplot
I have a dataframe (wi_hist_df) that contains three columns (below I have printed a part of it):
weights Frequency Criterion
1 0.2425 2 Criterion_1
2 0.2475 15 Criterion_1
3 0....
1
vote
1
answer
42
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
21
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
43
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 ...