Questions tagged [scale-color-manual]
The scale-color-manual tag has no usage guidance.
scale-color-manual
58
questions
1
vote
1
answer
37
views
ggplot of multiple geom_sf datasets gives mismatched legend colours
I am trying to create a ggplot map which includes two simple feature line datasets. I would like the lines to either appear in the same legend, or a separate legend. However the approach I am taking ...
0
votes
1
answer
29
views
Using a color scheme and legend labels in plot_model
I would like to plot the results of a multilevel model in R, specifically to illustrate an interaction effect, using plot_model from sjPlot. I would like to use a specific color scheme and I would ...
0
votes
1
answer
42
views
use two different viridis colour palettes in a single plot [duplicate]
I would like to use two different viridis colour palettes with scale_color_viridis_c to show differences between the two different groups (a and b). Is there a way to change my code below in a way ...
1
vote
2
answers
58
views
R boxplot ggplot2 4 group but 6 parameter
I am trying to get some customized boxplot using ggplot2 on this data.
> dput(Family.boxplot)
structure(list(X.Datasets = c(7845L, 7846L, 7847L, 7848L, 7849L,
7866L, 7867L, 7868L, 7869L, 7857L, ...
1
vote
1
answer
39
views
R coloring and adding lines on a loop
I want to generate a ggplot by adding different lines on a loop. Each line should have its own color. I have attempted this:
scenario_colors <- c(
"scenario1" = "black",
&...
1
vote
1
answer
33
views
Why is ggplot scale_manual not correctly rendered in ggplotly?
I am using ggplot scale_manual to extend legend items to include values absent in the data and it works. However, when I use ggploty to render it, it doesn't work. Is there a work around this?
lims &...
0
votes
1
answer
62
views
ggplot2 geom_point with both a gradient fill and border color [duplicate]
I'm trying to create an R ggplot2 geom_point plot where the points are gradient filled according to a numeric value, sized according to a numeric value, and border colored according to a boolean value....
1
vote
1
answer
36
views
Shiny in R: apply self-defined function in scale_color_manual() to change the colour of plots based on user-selected variable
I used Shiny application to create scatter plots or box plots based on their selection of variables. I got an error with the usage of ggplot2::scale_color_manual() within the renderPlot() function and ...
0
votes
2
answers
81
views
R Geom Line, color and shape for the same figures
I used "scale_shape_manual" and "scale_color_manual" to color and shape 5 different variables, they are not on the same column. I want the legend to be just one merged, not ...
0
votes
1
answer
42
views
Conflict between scale_color_gradient2() and scale_color_manual()
What I want is to remove diffmean legend produced by geom_segment() and scale_color_gradient2() and add legend for both dotted line and solid line (geom_line()). I have tried:
ggplot2::geom_segment(...
0
votes
1
answer
56
views
ggplot2: scale_color and scale_shape of different lengths
I'm trying to re-create this plot in R, but can't seem to get things to match. As I understand it, if I only want 1 legend (shapes and colors in one legend), then scale_shape_manual and ...
0
votes
1
answer
406
views
Making a custom scale_color_gradient but assigning number values to the colors
I'm having trouble getting a custom color gradient to work. I want to assign certain colors to certain values but have the colors flow. This is what I've got so far.
thi_color_scale<-...
0
votes
2
answers
185
views
geom_abline doesn't recognize scale_color_manual colors
I have disparate datasets I'm bringing together with ggplot. I can get the colors for lines and legend to work with geom_line, but not geom_abline. For example, this works:
df1 <- data.frame(year=c(...
1
vote
1
answer
91
views
Conditional text colour based on background colour (High contrast text) for ggplot (geom_col, and geom_text)
Hello you clever R people!
I'm trying to create a stack bar plot showing soil thicknesses with a specific background colour and then add labels to the plot that change colour depending on the ...
0
votes
1
answer
75
views
ggplot2 stacked column: How do I sort by date, use custom colors and change the legend?
Separately these seem easy, but I can only complete two of the requirements before breaking the third. What I want to do with a stacked column chart:
Group by week and order the stacked bar chart ...