Questions tagged [scale-color-manual]
The scale-color-manual tag has no usage guidance.
scale-color-manual
58
questions
1
vote
1
answer
4k
views
Custom colors for discrete values in geom_bar in ggplot R
I am converting a histogram with counts to a proportion chart. I want to make the seven columns on the left green (x values 0-6), the next two are orange (7,8), and the right columns (9 and 10) red. ...
1
vote
1
answer
618
views
How to make colors change in a function for monthly plots?
I have spatial-temporal data of migrating species and I want to make a GIF showing their movement throughout the year on a monthly basis. I'm using this code to produce a picture for each month:
eb &...
0
votes
0
answers
97
views
How to exclude legend for a particular plot with multiple plots using scale_color_manual in ggplot2?
I am trying to plot multiple plots using ggplot2 in R.
I would like to set manual color pallette and exclude geom_line and geom_point with data_1 in scale_color_manual. Is there a way I can do it?
...
1
vote
1
answer
122
views
Making multi-line plots in R using ggplot2
I would like to compile some data into a ggplot() line plot of different colors.
It's rainfall in various places over 100 days, and the data is quite different between locations which is giving me ...
1
vote
2
answers
1k
views
Show entire legend even when a category is not displayed in the graph
I am working on a graph to show the hitting patterns of baseball players.
The location on a grid corresponds to where the ball was hit, and the colour of the circle corresponds to the outcome (single, ...
1
vote
1
answer
202
views
Changing default plot colors in R for categorical values
I just scripted the plot below, for which I would like to modify the colors:
library(ggplot2)
library(arm)
df <- tibble::tribble(~Proportion, ~Lower,~Upper, ~Area,~Time,
...
-1
votes
1
answer
72
views
How to draw different colors on graph line and insert legend (color and column title)
I've tried assigning colors to each line. But, can't figure out how to show legend result as I want.
groupcolours <- c(NE="#999999",NS="#E69F00",NW="#56B4E9",NN="#009E73")
I input the following ...
3
votes
2
answers
2k
views
How to display coloured group correlations with scale_colour_manual in ggpairs (R)?
I'm using ggpairs for data with 3 groups. The problem is that not all variables have all groups and therefore, some correlations only need to show 2 groups. Because of the automatic alphabetical ...
0
votes
1
answer
497
views
Replacement has [x] rows, data has [y] when using scale_color_manual
I am making a plot using ggplot2 n R 3.2.3, with a template that I've been using for long time successfully. I am now getting the same error as in here and here (replacement has %d rows, data has %d).
...
0
votes
0
answers
117
views
How to scale color by the combination of two values in ggplot2?
I have a graph where I want the color of each point to be scaled by its x AND y values. I.e.:
high x AND high y values: darker colors
low x OR low y values: lighter colors
Is this possible? and if ...
1
vote
1
answer
566
views
Add legend to ggplot2 line with point plot
I have a question about legends in ggplot2. I managed to plot two lines and two points in the same graph and want to add a legend with the two colors used. This is the code used
P <- ggplot() + ...
0
votes
0
answers
58
views
Making two data points in one variable one color while the rest are another color
I have a dataset of acoustic receiver locations and want to highlight two of them on the map I am making. I would like two of them to be red, while all others are black. Here's my code:
geom_point(...
0
votes
1
answer
450
views
Wrongly labels in legend of ggplot2 using scale_color_manual with data from multiple geoms
I want to display several sets of curves in the same ggplot.
That part works fine, but when I compare the curves with the
content in the plot legend, the order seems to be changed
(so that the red ...