Displaying 18 results from an estimated 18 matches for "scale_fill_discrete".
2013 Sep 18
1
ggplot2: changing strip text in facet_grid and a legend text problem
...nt the panes labelled on top and on the right side of the graph. I want however, the text horizontally on the right side.
I do not understand why facet_grid plotted it this way for me. Why?
I would also like to change the text in the legend of this plot.
I have tried several solutions including:
scale_fill_discrete(guide = guide_legend(), labels=c("cyanobacteria", "zooplankton"))
scale_fill_discrete(name="organism",
breaks=c("cyano", "seston"),
labels=c("cyanobacteria", "seston"))
for some re...
2009 Jan 29
2
Adding vertical line to histogram and qplot "stacked" plot
...ical line to a histogram and qplot "stacked" plot? Here is my current attempt:
"qplot" approach attempt:
qplot(Run, data = data_dataframe, breaks = breaks, fill = Temperature, main = short_title) + scale_x_continuous("Data") + scale_y_continuous("Freq") + scale_fill_discrete("Temperature") + scale_fill_manual(values = c(LOW = "blue", AMB ="black", HIGH = "red")) + geom_abline(v = HighVal, col = "dodgerblue3", lty="dotdash")
"hist" approach attempt:
hist(data_dataframe, breaks = breaks, col = &...
2023 Feb 21
2
Problem of intercept?
...taset)$coef)
}
coef=data.frame(rbind(a,b))
coef$Model=c('Multi','Single')
library(reshape2)
coef.long<-melt(coef,id.vars="Model")
?
library(ggplot2)
ggplot(coef.long,aes(x=variable,y=value,fill=Model))+
? geom_bar(stat="identity",position="dodge")+
? scale_fill_discrete(name="Model",
? labels=c("Multiple", "Simple"))+
? labs(title =paste('La diff?rences des coefficients
? entre la r?gression multiple et simple'),
? x="Models",y="Coefficient")+
? coord_flip()
?
?
?
2009 Oct 14
1
change order of bar plot categories
...t;Dark","light"),3)
avg<-dat.avg2[,3] #
se<-dat.avg2[,4]
dat.avg.temp<-data.frame(cbind(avg,se))
dat.avg.temp<-data.frame(cbind(temp,light,dat.avg.temp))
dat.plot<-qplot(light,avg, fill=factor(temp),data=dat.avg.temp,
geom="bar", position="dodge") + scale_fill_discrete("Temp",labels=c('Low','Medium','High'))
dat.plot
Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA
--- On Wed, 10/14/09, Wade Wall <wade.wall at gmail.com> wrote:
> From:...
2009 Jan 28
1
Changing histogram stack in qplot
...ack
High = Red
Here is pseudo code of what I have currently:qplot(Run, data = TestData, breaks = hist_breaks, ,
fill = TestData$Temperature,
main = short_title) +
scale_x_continuous("Run, Radians") + scale_y_continuous("Frequency") +
scale_fill_discrete("Temperature")
Thanks for any advice and insights.
[[alternative HTML version deleted]]
2009 Jan 30
1
Using ggplot2 I need to move the location of legend to on the plot
...en't stumbled on a description of how to move around the location of the legend.
Here is what I have so far:
qplot(Age, data = combined_data, binwidth = 1,
fill = combined_data$Type) +
scale_x_continuous("Age") + scale_y_continuous("Freq") +
scale_fill_discrete("Type")
I'm guessing there is a way to move the legend some place thanks again.
[[alternative HTML version deleted]]
2009 Jul 21
1
legend title in qplot
Hi,
I've used the following command in qplot
qplot(a$V1,geom="histogram",binwidth=0.15,fill =
factor(a$V2),ylab="Frequency",xlab="Rate");
but the title in the legend shows up as factor(a$V2)...how can i change
this?
--
Rajesh.J
[[alternative HTML version deleted]]
2013 Feb 20
1
ggplot2 customizing a plot
...
tdm <- melt(DataToPlot)
p<- ggplot(tdm, aes(x = Var2, y = Var1, fill = factor(value))) +
labs(x = "MHz", y = "Threshold", fill = "Duty Cycle") +
geom_raster() +
scale_fill_discrete()
[[alternative HTML version deleted]]
2013 Feb 25
1
ggplot2 Increase font size
Dear all,
I am using the code as below
tdm <- melt(matrixToPlot)
p<- ggplot(tdm, aes(x = Var2, y = Var1, fill = factor(value))) +
labs(x = "Mz", y = "T", fill = "D") +
geom_raster(alpha=1) +
scale_fill_discrete(h.start=1) +
scale_x_continuous(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0))
to plot an two dimensional image .
I would like to ask your help to replace the gray border with white color and increase the font size of x and y axis as wells as the lege...
2009 Jul 28
2
Density plot in ggplot2
Hi all, I was trying to draw a stacked density plot like that :
library(ggplot2); library(plyr)
dat <- cbind(rnorm(300), rep(c(1,2), each=150))
ggplot() + geom_density(aes(x=dat[,1], fill=factor(dat[,2]),
position="stack")) +
xlab("") + ylab("") +
scale_colour_manual(name = "Pallet", labels = c("X", "Y"))
Here
2013 Mar 25
2
Plot Matrix with Data
...reshape2)
library(ggplot2)
tdm <- melt(Data)
ggplot(tdm, aes(x = Var2, y = Var1, fill = factor(value)),levels=seq(0,1,by=0.1)) +
labs(x = "MHz", y = "Threshold", fill = "Duty Cycle") +
geom_raster(alpha=1) +
scale_fill_discrete(h.start=1,breaks=c(20,30,40,50,60,70,80,90),labels=c(20,30,40,50,60,70,80,90),fill="red") +
scale_x_continuous(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0))
# End of code part
What I wanted to do is to print the values
below 20, wi...
2023 Feb 22
1
Problem of intercept?
...))
> coef$Model=c('Multi','Single')
> library(reshape2)
> coef.long<-melt(coef,id.vars="Model")
>
> library(ggplot2)
> ggplot(coef.long,aes(x=variable,y=value,fill=Model))+
> geom_bar(stat="identity",position="dodge")+
> scale_fill_discrete(name="Model",
> labels=c("Multiple", "Simple"))+
> labs(title =paste('La diff?rences des coefficients
> entre la r?gression multiple et simple'),
> x="Models",y="Coefficient")+
> coord_flip()
>
>
>
>...
2012 Aug 04
2
ggplot2 boxplot help
Hello,
I have a data set that looks like this:
name G-ID test_id g-id g
1 00077464 C_068131 C_068131 OC_068131 -
2 00051728 C_044461 C_044461 OC_044461 -
3 00058738 C_050343 C_050343 OC_050343 -
4 00059239 C_050649 C_050649 OC_050649 -
5 00001761 C_000909 C_000909 OC_000909 -
6 00005119 C_002752 C_002752 OC_002752 -
locs
2012 Jun 06
5
ggplot incorrect legend
How do I create a legend with ggplot?
I think should be getting the FuelTypeNum in the legend.
Plot:
http://r.789695.n4.nabble.com/file/n4632471/Rplot.jpeg
My code is:
ggplot(data=tempTable, aes(x=Bands8, y=SubPercent, fill=FuelTypeNum)) +
geom_bar(position="stack", stat="identity") +
scale_colour_hue('my legend', breaks = levels(tempTable$FuelTypeNum),
2011 Dec 04
1
Polishing my geom_bar for publication
Dear list,
I am new with ggplot2 and I have spend quiet some time putting together the following code to create the attached plot. However there's still a few things that I'm having trouble with!
I would be grateful if someone can tell me how to fix (1) the colour of my bars into grey scales (2) removing the y-axis (species name) on the right figure to avoid duplication, and (3) fix the
2013 Mar 13
4
boxplot
Hi,
I try to boxplot following data on the subset of (V1,V3,V5,V7) and
(V2,V4,V6,V8)
V1 V2 V3 V4 V5 V6 V7 V8
2 4 6 7 12 33 43 53
how can I use boxplot function to plot it?
thanks,
William
2017 Jun 29
1
Changing ggplot2 legend key/title to custom text
Hi Petr and thanks for your reply,
That's the problem I don't want to modify the labels of my legends but the title of the legend in itself inserting my custom text :)
Take for example the 1st graph in this tutorial
http://www.sthda.com/english/wiki/ggpubr-r-package-ggplot2-based-publication-ready-plots
I want to change the "sex" in "sex subscript 2" or "
2009 Jan 28
2
t.test in a loop
Hi All,
I've been having a little trouble with creating a loop that will run a a
series of t.tests for inspection,
Below is the code i've tried, and some checks i've looked at.
I've used the get(paste()) idea as i was told previously that the use of the
eval should try and be avoided.
I've run a single syntax to check that my systax is correct and works
without any problems