search for: scale_fill_manual

Displaying 20 results from an estimated 50 matches for "scale_fill_manual".

2010 Dec 17
1
ggplot missing fill colours in boxplot legend
...nd Day 2 is left blank. Instead the little boxes next to the labels (Day 1, Day 2) are both unfilled (white). The boxplots are filled properly, but without the fill colour in the legend its difficult decipher the plot p=ggplot(CorbulaMR3,aes(factor(Site),VO2)) p+geom_boxplot(aes(fill=factor(Day)))+scale_fill_manual('Day', breaks = c('Day 1', 'Day 2'), + values = c('grey','black'), + labels = c('Day 1', 'Day 2'))+xlab('Sampling Site')+ylab('Metabolic Rate')+opts(title="Sampling") I've played around and if I don't...
2015 Jun 16
4
Ayuda boxplot ggplot2
...e Y, es decir, que las dos lleguen a 60? Adjunto el boxplot y a continuación el código que usé para producirlo. vplayout <- function(x, y) viewport(layout.pos.row = x, layout.pos.col = y) tor<-ggplot(parasitos, aes(x=Arrenurus, y = torax, fill= Arrenurus)) + geom_boxplot(binwidth = 2) + scale_fill_manual(values = c("lightgreen", "lightblue"))+ ylab("Total parásitos")+ xlab("")+ ggtitle("Parásitos en el tórax") abd<- ggplot(parasitos, aes(x=Arrenurus, y = abdomen, fill= Arrenurus)) + geom_boxplot(binwidth = 2) + scale_fill_manual(values = c(...
2010 Jun 30
2
ggplot qplot bar removing bars when truncating scale
...$Q,data$mean,fill=data$variable,geom="bar",stat="identity",position="dodge",binwidth=2,ylab=NULL,xlab=NULL,width=.75) #With 0-6 Scale p + scale_x_discrete(expand=c(0,0)) + scale_y_continuous(limits=c(0,7),breaks=seq(from=0,to=6,by=.5),expand=c(0,0)) + coord_flip() + scale_fill_manual(values=c("darkmagenta","lightgoldenrod1")) + opts( panel.background = theme_rect(colour = NA), panel.background = theme_blank(), panel.grid.minor = theme_blank(), axis.title.x= theme_blank(), axis.title.y= theme_blank(), axis.text.y=theme_text(size=12,hjust=1...
2018 Nov 08
2
ggplot con muchos colores
Buenos días, estoy haciendo unos mapas con ggplot, con 29 categorías, por lo que tengo que utilizar library(RColorBrewer) para disponer de suficientes colores. El problema es que al hacerlo acorde a dos variables distintas (color=var1 y color=var2), cuyas 29 categorías son obviamente las mismas, les da distintos colores y no puedo comparar los mapas. Muchas gracias, Manuel
2011 Oct 21
2
stacked plot
Hi! I am trying to use ggplot2 to create a stacked bar plot. Previously I tried using barplot() but gave up because of problems with the positioning of the legend and other appearance problems. I am now trying to learn ggplot2 and use it for all the plots that I need to create for my dissertation. I am able to create normal bar plots using ggplot2, but I am stomped with the stacked bar plots.
2011 Sep 07
2
ggplot2-Issue placing error bars behind data points
...ts,width=0.2) +xlab("Time (min)") +xlim(c(0,50)) +ylab("Normalized Spontaneous Action Potential Rate") +ylim(c(0,1.6)) +scale_shape_manual("Acclimation Temperature",breaks=c(8,18,25), labels=c("25 ºC", "18 ºC", "8 ºC"),values=c(21,21,21)) +scale_fill_manual("Acclimation Temperature",breaks=c(8,18,25), labels=c("25 ºC", "18 ºC", "8 ºC"),values=c(colours()[c(173,253,218)])) +scale_colour_manual("Acclimation Temperature",breaks=c(8,18,25), labels=c("25 ºC", "18 ºC", "8 ºC"),...
2009 Jan 29
2
Adding vertical line to histogram and qplot "stacked" plot
...d" 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 = "dodgerblue3", xlab="Data"...
2012 Apr 20
1
ggplot2: Legend title
...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"), breaks=c("PCT_ENR_FALL1", "PCT_ENR_FALL2"), labels=c("1st fall", "2nd fall")) + scale_shape_manual(values=c(21, 22), breaks=c("PCT_ENR_FALL1&quo...
2008 Sep 25
2
ggplot, qplot in loop
...ytitle <- paste("Development of Cover, ", trials[i],",sep = "") myplot <- qplot(dateofsurvey, cover, data=mydata, geom="area", fill=cover_of, main = mytitle, ylab="projective Cover[%]", xlab = "Year") myplot <- myplot + scale_fill_manual(values = mycolours) } If I have no loop, everything works, with the loop, no graphics device is openend, nothing happens, but the variables are filled with data (checked on the commandline), the SQL is executed, the result from the database is available, but nothing gets produced. If I execute...
2011 Nov 16
1
geom_bar with missing data in package ggplot
Dear all, I was hoping someone could help with a ggplot question. I would like to generate a faceted bar chart, but missing data are causing problems. g<-structure(list(Date = structure(c(11322, 11687, 12052, 11322, 11687, 12052, 11322, 11687, 12052, 11322, 11687, 12052), class = "Date"), variable = c("Govt Revenues to GDP", "Govt Revenues to GDP",
2013 Feb 04
1
ggplot and colors
...s function to draw somes lines and I want them to be all black (just to test) however, I dont get any black line in the figure. Do you have any experience with ggplot and manual colors?? ggplot(cmax, aes(cmax[,3], cmax[,6],colour=interaction(cmax[,1],cmax[,2]))) + geom_line() + geom_point() + scale_fill_manual(values=c("black", "black" , "black", "black", "black", "black", "black", "black", "black", "black", "black", "black" )) best regards -- PhD candidate in Computer Science A...
2013 Feb 20
1
ggplot2 customizing a plot
Dear all, I want some help improve my ggplot as following: Make the plottable area with grid, so is easy one to see where each box refers to x and y values. Add a color bar but with fixed values, that I want to specify. How   I can do those two? Before is some code what I have tried so far. Regards Alex
2009 Nov 04
1
Patterned shading in ggplot
...r the data I have. Any help much appreciated. library(ggplot2) xy<-data.frame(x=c(rnorm(1000), rnorm(1000,2,1)), grp=as.factor(rep(1:2, each=1000))) ggplot(xy, aes(x=x, fill=grp, group=grp)) + geom_histogram(binwidth=0.5,colour="black",position = "identity", alpha = 0.5) + scale_fill_manual(values = c("red", "blue")) -- View this message in context: http://old.nabble.com/Patterned-shading-in-ggplot-tp26193795p26193795.html Sent from the R help mailing list archive at Nabble.com.
2008 Jun 13
1
overlaid transparent histograms
...e="languageR") attach(lexdec) x <- log(c(BNCw, Frequency)) label <- c(rep("BNCw", length(BNCw)), rep("CELEX", length(Frequency))) h <- data.frame(x, label) g <- ggplot(h, aes(x=x, fill=label)) g + geom_bar(position="identity") + scale_fill_manual(values = c( alpha("red", 0.5), alpha("blue", 0.5))) detach(lexdec) --8<---------------cut here---------------end--------------->8--- Three questions: 1a) Why does the following code not produce transparen...
2023 Mar 27
1
Cambiar orden top-down stacked area ggplot2
...imes=6)) sbcd<-c(0, 0, 0, 0, 0, 0, 0, 90, 164, 132, 175, 234, 6, 0, 265, 73, 143, 595, 560, 94, 3, 256, 72, 157, 657, 618, 143, 3, 279, 75, 180, 688, 711, 205, 5, 275, 95, 185, 672, 817, 305, 5) data <- data.frame(year, sbcd, cat) ggplot(data, aes(x=year, y=sbcd, fill=cat)) + geom_area()+ scale_fill_manual(values=c("lightgoldenrodyellow","#FEE391","#FEC44F","#FE9929","#CD6600","#8B1A1A","red")) [[alternative HTML version deleted]]
2011 Jul 24
1
barplot colors
Hi, In barplot(height, col = ...), the col = vector recycles so that the same colors are used for each bar. I would like to use different colors in different bars (corresponding to another piece of information, here, the region of the country being represented). For example, x = matrix(c(5,2,3,1),nrow=2) barplot(x,col=1:4) will draw two bars with two segments each, but each colored red and
2009 Aug 19
2
ggplot2 legend problem
...lt;- data.frame(Y=rnorm(1000, mean=3)) xy <- cbind(x, y) g <- ggplot(xy) g + geom_histogram(aes(x=X), colour="black", binwidth = 0.1, fill = alpha("red", .5)) + geom_histogram(aes(x=Y), colour="black", binwidth = 0.1, fill = alpha("blue", .5)) + scale_fill_manual("Case", values = alpha(c("red","blue"), 0.5), limits=c("A", "B")) + opts(title = "A & B distributions") + xlab("Value") The plot is just what I want and looks gorgeous on my screen. However the legend boxes labeled &...
2013 Mar 28
2
ggplot2: less than equal sign
Hi I am trying to add a less than equal sign to a plot. I have previously done this using unicode but is not working in this instance. Any suggestions would be great thanks example code: library(ggplot2) df<-data.frame(vis=c(0,0,1,1) , count=c(10,15,20,10) , grp=c(0,1,0,1)) df$grp <-factor(df$grp ,levels=c(0,1) , labels =c("x \u2265 10" , "x > 10")) ggplot(df,
2008 Jan 24
4
two histograms in the same graph
Dear Contributors: I have two vectors x and z, and I want to display the histograms of both vectors in the same graph, x in red bars, z in blue bars. If you have any clue on how to do that, I will be very glad to hear it!!!!!! Thanks in advance again, Juan Pablo Fededa [[alternative HTML version deleted]]
2013 May 14
1
Tamaño plots y calidad en grafico ggplot
...uot;Nivel 2","Nivel 3","c","d") niveles=data.frame(inicio,fin,Niveles) Jurisdiction=rownames(mtcars) for (i in 1:length(Jurisdiction)) if(Jurisdiction[i]=="Fiat 128"){k=i} h <- ggplot(tabla, aes(x=factor(Jurisdiction), y=Mean, ymin=245, ymax=305)) h + scale_fill_manual(values = c("#A0551E", "#FA964B","#E1EBFF", "#B4CDFF", "#055014","#A0551E"))+ geom_hline(yintercept = seq(245, 305, 10), linetype=2, colour="#E1EBFF")+ geom_vline(xintercept = seq(1, 33, 2.5), linetype=1, colour="#E1EBFF&quo...