Displaying 20 results from an estimated 41 matches for "scale_color_manual".
Did you mean:
scale_colour_manual
2023 Aug 02
2
Choosing colours for lines in ggplot2
...df
ggplot(df,aes(Year,Flow,group=Stat,colour=Stat))+
coord_cartesian(ylim = c(0, 10)) +
geom_line()+
geom_point()
## this works
## BUT:
## code 2
col.2<-cb8[4:5]
ggplot(df,aes(Year,Flow,group=Stat,colour=Stat))+
coord_cartesian(ylim = c(0, 10)) +
geom_line()+
geom_point()+
scale_color_manual(values =cb8[4:5])+
theme_bw()
## this gives error message Error: Continuous value supplied to discrete
scale
## However this example using code from the net does work so I don't
understand why my ## second code doesn't work.
## code 3
df.1 <- data.frame(store=c('A', 'A&...
2017 Jun 30
0
Multiple "scale_color_manual" statements in one plot (ggplot2, flexible legend challenge)
...but not for the lines.
Attached the sample code and sample data.
I tried to add "color" arguments to the "geom_smooth" and "geom_line" and
doesn't work. I think the problem is I need to separate the color schemes
for lines and points, but I can't use multiple scale_color_manual statement
in one ggplot.
Jun Shen
####sample data#########
df1 <- structure(list(Y2 = c(0L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 0L, 0L, 0L, 0L), X = c(27L, 8L,
33L, 53L, 100L, 52L, 9L, 60L, 50L, 10L, 3L, 30L, 50L, 15L, 90L,
48L, 110L, 75L, 72L, 150L, 47L, 30L),...
2020 Oct 23
5
How to shade area between lines in ggplot2
...olNum]
head(trainset); str(df)
svm_model<- svm(z ~ .,
data = trainset,
type = "C-classification",
kernel = "linear",
scale = FALSE)
#! plot
p = ggplot(data = trainset, aes(x=x, y=y, color=z)) +
geom_point() + scale_color_manual(values = c("red", "blue"))
# show decision boundaries
w = t(svm_model$coefs) %*% svm_model$SV # %*% = matrix multiplication
slope_1 = -w[1]/w[2]
intercept_1 = svm_model$rho / w[2]
p = p + geom_abline(slope = slope_1, intercept = intercept_1)
### here we go: can I use a shaded a...
2020 Oct 23
2
How to shade area between lines in ggplot2
also from this site: https://plotly.com/ggplot2/geom_ribbon/
I get the answer is geom_ribbon but I am still missing something
```
#! plot
p = ggplot(data = trainset, aes(x=x, y=y, color=z)) +
geom_point() + scale_color_manual(values = c("red", "blue"))
# show support vectors
df_sv = trainset[svm_model$index, ]
p = p + geom_point(data = df_sv, aes(x=x, y=y),
color="purple", size=4, alpha=0.5)
# show hyperplane (decision boundaries are off set by 1/w[2])
w = t(svm_model$coe...
2024 Jul 18
1
ggplot two-factor legend
...background = element_blank())+
>> ????theme(axis.line = element_line(colour = "black"))+
>> ?? theme(axis.text=element_text(size=18))+
>> ?? theme(axis.title=element_text(size=20))+
>> ????ylab("Anteil BFF an LN [%]") +xlab("Jahr")+
>> ????scale_color_manual(values=c("red","dark green"), labels=c("?LN",
>> "BIO"))+
>> ????scale_fill_manual(values=c("red","dark green"), labels= c("?LN",
>> "BIO"))+
>> ????theme(legend.title = element_blank())+
>>...
2020 Oct 23
0
How to shade area between lines in ggplot2
...l<- svm(z ~ .,
> data = trainset,
> type = "C-classification",
> kernel = "linear",
> scale = FALSE)
>
> #! plot
> p = ggplot(data = trainset, aes(x=x, y=y, color=z)) +
> geom_point() + scale_color_manual(values = c("red", "blue")) # show
> decision boundaries w = t(svm_model$coefs) %*% svm_model$SV # %*% =
> matrix multiplication
> slope_1 = -w[1]/w[2]
> intercept_1 = svm_model$rho / w[2]
> p = p + geom_abline(slope = slope_1, intercept = intercept_1) ### here we...
2013 Apr 03
7
Canadian politcal party colours in ggplot2
A stupid question but does anyone know how to express the actual colours used by the main Canadian political parties? I want to do a couple of ggplot2 plots and have lines or rectangles that accurately reflect the party colours.
I can probably play around with RColorBrewer or something to figure it out but if some some already has got them it would save me some time especially with the NDP
2020 Jul 28
2
Superponer mapas en ggplot
...niendo el gradiente. He pensado,
también, en crear una nueva variable, combinación de las dos, que me
permitiera hacer eso mismo, pero no encuentro la forma.
Gracias por vuestra ayuda, una vez más,
Manuel
ggplot(legend=FALSE)+
geom_point(data=NCDS,aes(x=lon,y=lat,color= PA),shape=15,size=1) +
scale_color_manual(values=c("white","grey70"))+
geom_path(data=map_data('world'), aes(x=long, y=lat,group=group))
ggplot(legend=FALSE)+
geom_point(data=NCDS,aes(x=lon,y=lat,color= ExtTG7085),shape=15,size=1) +
# PTP o FTP
scale_colour_gradient2(low =
"white",high="RED...
2012 Apr 20
1
ggplot2: Legend title
...entage, group=Enrolled_by,
color=Enrolled_by, shape=Enrolled_by, fill=Enrolled_by)) +
geom_line() + geom_point(size=3.5) +
scale_y_continuous(breaks=seq(0, 100, 10), limits=c(0, 100),
labels=paste(seq(0, 100, 10), "%", sep="")) +
scale_color_manual(values=c("orange", "red"),
breaks=c("PCT_ENR_FALL1", "PCT_ENR_FALL2"),
labels=c("1st fall", "2nd fall")) +
scale_fill_manual(values=c("orange", "red"),
bre...
2012 Oct 22
1
how to group smooth line by two groups?
...group, i need to plot two, one type is solid, the other type is dotted. how
to do it?
I tried a color plot with the following code. what should i change "color"
to?
pb <- ggplot(data, aes(x = a, y = b,
color = char, linetype = factor(sex)))
p0 <- pb +
scale_color_manual(values = c("#00FFFF", "#FFFF00", "#00FF00")) +
scale_linetype_manual(breaks=c("0","1"), values=c(1,2), labels = c("male",
"female")) +
geom_smooth(method = "lm",
se = FALSE, # Don't add shaded con...
2020 Oct 23
2
How to shade area between lines in ggplot2
...area between lines in ggplot2
> >
> > also from this site: https://plotly.com/ggplot2/geom_ribbon/
> > I get the answer is geom_ribbon but I am still missing something ``` #! plot
> > p
> > = ggplot(data = trainset, aes(x=x, y=y, color=z)) +
> > geom_point() + scale_color_manual(values = c("red", "blue")) # show
> > support vectors df_sv = trainset[svm_model$index, ] p = p +
> > geom_point(data = df_sv, aes(x=x, y=y),
> > color="purple", size=4, alpha=0.5) # show hyperplane
> > (decision
> > bou...
2020 Oct 23
0
How to shade area between lines in ggplot2
...Subject: Re: [R] How to shade area between lines in ggplot2
>
> also from this site: https://plotly.com/ggplot2/geom_ribbon/
> I get the answer is geom_ribbon but I am still missing something ``` #! plot
> p
> = ggplot(data = trainset, aes(x=x, y=y, color=z)) +
> geom_point() + scale_color_manual(values = c("red", "blue")) # show
> support vectors df_sv = trainset[svm_model$index, ] p = p +
> geom_point(data = df_sv, aes(x=x, y=y),
> color="purple", size=4, alpha=0.5) # show hyperplane
> (decision
> boundaries are off set by 1...
2024 Jul 18
1
ggplot two-factor legend
...width=1) +
> theme(panel.background = element_blank())+
> theme(axis.line = element_line(colour = "black"))+
> theme(axis.text=element_text(size=18))+
> theme(axis.title=element_text(size=20))+
> ylab("Anteil BFF an LN [%]") +xlab("Jahr")+
> scale_color_manual(values=c("red","dark green"), labels=c("?LN",
> "BIO"))+
> scale_fill_manual(values=c("red","dark green"), labels= c("?LN",
> "BIO"))+
> theme(legend.title = element_blank())+
> theme(legend.text=ele...
2024 Jul 18
2
ggplot two-factor legend
..., formula = y ~ x +
I(x^2),linewidth=1) +
theme(panel.background = element_blank())+
theme(axis.line = element_line(colour = "black"))+
theme(axis.text=element_text(size=18))+
theme(axis.title=element_text(size=20))+
ylab("Anteil BFF an LN [%]") +xlab("Jahr")+
scale_color_manual(values=c("red","dark green"), labels=c("?LN",
"BIO"))+
scale_fill_manual(values=c("red","dark green"), labels= c("?LN",
"BIO"))+
theme(legend.title = element_blank())+
theme(legend.text=element_text(size=20))+
sca...
2024 Aug 16
2
boxplot notch
..."identity", notch=TRUE
) +
theme(panel.background = element_blank())+
theme(axis.line = element_line(colour = "black"))+
theme(axis.text=element_text(size=18))+
theme(axis.title=element_text(size=20))+
ylab("Anteil BFF an LN [%]") +xlab("Jahr")+
scale_color_manual(values=c("red","darkgreen"), labels=c("?LN", "BIO"))+
scale_fill_manual(values=c("red","darkgreen"), labels= c("?LN", "BIO"))+
theme(legend.title = element_blank())+
theme(legend.text=element_text(size=20))
p1<...
2020 Oct 26
0
How to shade area between lines in ggplot2
...ines in ggplot2
> > >
> > > also from this site: https://plotly.com/ggplot2/geom_ribbon/
> > > I get the answer is geom_ribbon but I am still missing something ```
> > > #! plot p = ggplot(data = trainset, aes(x=x, y=y, color=z)) +
> > > geom_point() + scale_color_manual(values = c("red", "blue")) #
> > > show support vectors df_sv = trainset[svm_model$index, ] p = p +
> > > geom_point(data = df_sv, aes(x=x, y=y),
> > > color="purple", size=4, alpha=0.5) # show
> > > hyperplane (de...
2017 Aug 04
1
legend and values do not match in ggplot
...are given in the plot do
not match with the values specified in the codes given below. Your helps
highly appreciated.
Greg
library(ggplot2)
p <- ggplot(a,aes(x=NO_BMI_FI_beta ,y=FI_beta ,color= Super.Pathway))+
theme_bw() +theme(panel.border=element_blank()) +
geom_point(size=3)
p2<-p+scale_color_manual(name="Super.Pathway",
labels=c("Amino Acid", "Cofactors and Vitamins", "Carbohydrate", "Energy",
"Lipid", "Peptide", "Nucleotide"),
values=c("Amino Acid"="red",
"Cofactors and Vitamins"=...
2024 Aug 16
1
boxplot notch
...und = element_blank())+
>
> theme(axis.line = element_line(colour = "black"))+
>
> theme(axis.text=element_text(size=18))+
>
> theme(axis.title=element_text(size=20))+
>
> ylab("Anteil BFF an LN [%]") +xlab("Jahr")+
>
> scale_color_manual(values=c("red","darkgreen"), labels=c("?LN", "BIO"))+
>
> scale_fill_manual(values=c("red","darkgreen"), labels= c("?LN", "BIO"))+
>
> theme(legend.title = element_blank())+
>
> theme(legen...
2011 Aug 09
1
ggplot2 setting colors for individual groups.
...or gradient, I would like make the
values between A and B a set color, between B and C another color, and
so on. That's where I'm having an issue, because the values are all
continuous data, and it seems like the only thing which will let me
get anything close to what I would like (such as scale_color_manual)
requires a discrete dataset.
I've reached an impasse with this and could really use some advice.
Thanks everyone!
A
--
Adrienne Wootten
Graduate Research Assistant
State Climate Office of North Carolina
Department of Marine, Earth and Atmospheric Sciences
North Carolina State University
--...
2024 Aug 16
1
boxplot notch
...dentity", notch=TRUE
) +
theme(panel.background = element_blank())+
theme(axis.line = element_line(colour = "black"))+
theme(axis.text=element_text(size=18))+
theme(axis.title=element_text(size=20))+
ylab("Anteil BFF an LN [%]") +xlab("Jahr")+
scale_color_manual(values=c("red","darkgreen"), labels=c("?LN", "BIO"))+
scale_fill_manual(values=c("red","darkgreen"), labels= c("?LN", "BIO"))+
theme(legend.title = element_blank())+
theme(legend.text=element_text(size=20))
p1...