Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
1 answer
43 views

Edit legend title in ggplot2 (3.5.1) [duplicate]

I have successfully edited the x and y axis titles, but I'm stuck on the legend title and labels. Here is the code I have run so far: m.emo.plot <- interact_plot(model = m.emo, pred = cemodiff, ...
medusa's user avatar
  • 45
0 votes
1 answer
27 views

How to avoid overlapping legends for multiple geom_point layers in ggplot2

I'm trying to create a chart with 2 geom_points and a geom_text_repel layer. When I display my legend, the geom_points overlap. The main data points should be represented as empty circles, while the &...
NoNameBoyy's user avatar
0 votes
1 answer
39 views

I want to get two legends for two different groups in a two Y-Axis plot [closed]

so I have a two Y-Axis plot. Each Y-Axis is given a group of Data. I want to have two different legends for each group on left and right side of plot on the locations shown in the second picture. This ...
Nick Brown's user avatar
0 votes
1 answer
64 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&...
Ryan Gary's user avatar
  • 141
0 votes
1 answer
46 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....
Ryan Gary's user avatar
  • 141
-1 votes
1 answer
40 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 ...
Jason Liu's user avatar
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 ...
Jason Liu's user avatar
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 ...
Jason Liu's user avatar
0 votes
0 answers
34 views

Same scale in legend for circular bar plot

Building on this post and code (with reproducible example) Different fill color for negative values in circular barplot, I want to plot two of these figures together as a comparison, like this: But ...
MoonS's user avatar
  • 175
0 votes
1 answer
83 views

Improve presentation of logistic regression plot R ggplot2

It's my first time asking a question. I hope it is ok. Minimum reproducible example:plot library(tidyverse) OR <- c(0.98, 1.02, 1.00, 1.03) conf.low <- c(0.64, 0.69, 0.65, 0.68) conf.high <- ...
Anna's user avatar
  • 27
0 votes
1 answer
398 views

How to change the aesthetics of the legend when using plot_model in R?

I am currently using plot_model to plot a binomial generalized linear mixed effects model from an AIC model selection process. Overall, plot_model works well, but I am having trouble customizing the ...
NeedHelpWithR's user avatar
0 votes
0 answers
19 views

How to add a legend on a plot with multiple dataset with ggplot2 through R? [duplicate]

gfg_plot <- ggplot(NULL, aes(x = Area, y = Richness, fill = District )) + geom_point(data=District1, col="blue") + geom_point(data=District2, col="black")+ geom_point(data=...
Wanqing Tai's user avatar
0 votes
1 answer
283 views

Exporting plot panel as the same size no matter how wide the legend is

I’m having trouble exporting plots in ggplot. I want to display my data using different variables in different plots and have the plot panel size export to the same size every time. My issue is that ...
axc's user avatar
  • 3
1 vote
1 answer
80 views

Remove specific items from legend but keep aesthetic the same in ggplot

I would like to remove the no pipe items from the legend in this plot but keep the same plotting aesthetics. I have tried using scale_colour_discrete with breaks, which removed the intended items but ...
mrob27's user avatar
  • 73
0 votes
1 answer
92 views

ggplot2: remove alphabetic order in the legend after the pivot of the dataset

This is a sample of my dataset Year North Center South <dbl> <dbl> <dbl> <dbl> 1 1995 1115. 1057. 876. 2 ...
io_boh's user avatar
  • 313

15 30 50 per page
1
2 3 4 5
12