search for: scale_y_continu

Displaying 20 results from an estimated 123 matches for "scale_y_continu".

Did you mean: scale_y_continous
2012 Sep 19
2
ggplot formato dígitos en ggplot2
...etan en formato científico , cuando antes era normal. Es decir, mis valores máximos están sobre 300000, pero en el eje ahora pone 3e+05 y no he encontrado como cambiarlo. He visto que se puede cambiar utilizando el paquete scales y utilizando por ejemplo , siendo p un gráfico creado antes p + scale_y_continuous(labels=comma) que me lo pone en formato 300,000 , pero no he encontrado como poner 300000 sin comas ni puntos, ni que sea en notación científica. Parece que ggplot2 lo decide solo , ya que si hago p+ scale_y_continuous(limits=c(0, 10000)) si lo pone en formato normal. Gracias
2011 Jan 14
2
bug in qplot (library ggplot2)
Hello, this following code give a nice png: /library(ggplot2) i <- 1 png(file=paste('test ',i,'.png',sep='')) qplot(carat, data=diamonds, fill=color,geom='histogram')+scale_y_continuous(i) dev.off() / I would like to get more files, but the following code doesn't make any file: /library(ggplot2) for (i in 1:2) { png(file=paste('test ',i,'.png',sep='')) qplot(carat, data=diamonds, fill=color,geom='histogram')+scale_y_continuous(i)...
2007 Dec 11
2
ggplot - Setting the y-scale in a bar plot
...rame(x=factor(2:8), y=0.1*(2:8)) plot1<-ggplot() plot1<-plot1+layer(data=plotdata, mapping=aes_string(x='x',y='y'),geom='bar', stat='identity') RangeY <-c(0,1) YBreaks <- (0:10)*diff(RangeY)/10 YTickLabels<- as.character(YBreaks) plot2 <- plot1 + scale_y_continuous(limits=RangeY, breaks=YBreaks, labels=YTickLabels, expand=c(0,0)) print(plot2)
2010 Jan 18
2
ggplot2 histogramm
...ody a hint how i can do this. df <- data.frame(variable=sample(c("A","B","C"),1000,replace=T,prob=c(0.22,0.28,0.5)),group=gl(2,500)) p <- ggplot(df, aes(x = variable)) p + geom_histogram(aes(y= ..count.. / sum(..count..),fill=..count../sum(..count..)*100)) + scale_y_continuous(formatter = "percent") + facet_wrap(~group) + ylab("Anteil in %") + xlab("Attribute") + opts(title="Title",legend.text="Anteil in Prozent") + BaseTheme(base_size=12) many thanks, Christian
2007 Nov 01
1
ggplot2 - expand range?
Dear UserRs, I am trying to use systematically ggplot2 for most of my plots, but I am fighting some lack of documentation, which I try to overcome. I want to build a scatterplot where the axes cross exactly at (0,0). I tried using scale_y_continuous(limits=c(0,10)), but I always get an extra space at the bottom of the axes. The code I used is below. > plotdata<-data.frame(x=1:10, y=runif(10)) > plot<-ggplot() > plot<-plot+layer(data=plotdata, mapping=aes_string(x='x',y='y'), geom='point', st...
2013 Mar 25
2
Plot Matrix with Data
...old", 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, with an x color between 20-30, with a y clor between 30-40, with a z color and so on.... I would not care now for the color palette. Any would do. Could you please help me with that? Regards A...
2017 Oct 12
2
dual y-axis for ggplot
...s(y = air_temp, colour = "Temperature")) # adding the relative humidity data, transformed to match roughly the range of the temperature p <- p + geom_line(aes(y = rel_hum/5, colour = "Humidity")) # now adding the secondary axis, following the example in the help file ?scale_y_continuous # and, very important, reverting the above transformation p <- p + scale_y_continuous(sec.axis = sec_axis(~.*5, name = "Relative humidity [%]")) # modifying colours and theme options p <- p + scale_colour_manual(values = c("blue", "red")) p <- p...
2010 Nov 02
5
Question about ggplot2
Dear All, I am trying to graph a simple scatter plot where the x axis is year and the y axis is a percentage (percentage of infant death). Instead of plotting the raw data, I want to plot summary statistics such as mean and median. Here is the problem: the value range of y is between 0 and 1, but since infant death is a rare event, the mean and median is very low (something like 5%), which shows
2008 May 12
1
Converting qqplot2 qplot() to grammar?
...te-space around the plot. (If anyone has suggestions on removing these please let me know) I've come up with the following but it is not behaving the same way as the qplot above: ggplot(data = somdf, mapping = aes(x = pixX, y = pixY)) + layer(data = somdf, geom = "tile", fill=rgb) + scale_y_continuous(name=" ",breaks=" ") + scale_x_continuous(name=" ",breaks=" ") + scale_fill_identity() + coord_cartesian() + opts(aspect.ratio = .75) + facet_grid(unitX ~ unitY,margins=FALSE) The result is a plot where all tiles are filled with grey50, and not the data v...
2008 Jan 11
1
ggplot2, coord_equal and aspect ratio
...s in advance for your help. PS: x=runif(10) qplot(x*3, x) + coord_equal() produces some very strange scales. this looks like a bug to me. especially since: foo=x qplot(foo*3, foo) + coord_equal() works as expected PPS: I tried ggplot(data=a, aes(x=x,y=y)) + geom_point() + coord_equal() + scale_y_continuous(limits=c(0,1)) which has no effect. but the side effect of enforcing the square domain is that: ggplot(data=a, aes(x=x,y=y)) + geom_point() + coord_equal() + scale_y_continuous(limits=c(0,0.3)) has no effect either (i would expect to see only the points <0.3) JiHO --- http://jo.irisson....
2016 Sep 06
2
Ayuda con gráfico típico de histograma más linea
....character(ft$Share))) > > ggbar <- ggplot(ft, aes(x = hora, y = frec)) + > geom_area(fill= "gray") + > scale_x_datetime(date_breaks = "5 mins", date_labels = "%H:%M") + > theme(panel.background = element_rect(fill = "white")) + > scale_y_continuous(limits=c(0,1500)) + > labs(x = "Minutos", y = "Tweets") + # Etiquetas o títulos de los ejes > theme(axis.text.x=element_text(angle=90)) # Orientación texto eje x > > ggshr <- ggplot(ft, aes(x = hora, y = Share)) + geom_line(color="blue") + >...
2010 Jun 30
2
ggplot qplot bar removing bars when truncating scale
...quot;mean","variable","Q") data[,1]=mean #Plot p=qplot(data=data,data$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....
2012 Feb 01
1
ggplot2(0.9.0): could not find function "=="
...aes(Time)) + geom_bar(subset = .(variable == + "EXP"), aes(y = value, fill = BEC), stat = "identity") + + geom_bar(subset = .(variable == "IMP"), + aes(y = -value, fill = BEC), stat = "identity") + + xlab("") + scale_y_continuous("Export - Import", + formatter = "comma") Error in continuous_scale(c("y", "ymin", "ymax", "yend", "yintercept", : unused argument(s) (formatter = "comma") > ggp...
2007 Jul 14
1
scaling of different data sets in ggplot
...lot: ## data specification ggplot(data=data.frame(x,y,z)) + ## first set of points geom_point(mapping=aes(x=x,y=y)) + ## scale_y_log() + ## second set of points geom_point(mapping=aes(x=x,y=z),pch=3) + ## layer(mapping=aes(x=x,y=z),stat="smooth",method="loess") + ## scale_y_continuous() scale_y_log() and scale_y_continuous() appear to apply to both mappings at once, and I can't figure out how to associate them with the intended ones (I expect this will be a desire for size and color scales as well). Of course, I can always try to fool the system by (1) applying the scal...
2017 Oct 12
0
dual y-axis for ggplot
...mperature")) > > # adding the relative humidity data, transformed to match roughly the > range of the temperature > p <- p + geom_line(aes(y = rel_hum/5, colour = "Humidity")) > > # now adding the secondary axis, following the example in the help file > ?scale_y_continuous > # and, very important, reverting the above transformation > p <- p + scale_y_continuous(sec.axis = sec_axis(~.*5, name = "Relative > humidity [%]")) > > # modifying colours and theme options > p <- p + scale_colour_manual(values = c("blue", &...
2008 Oct 15
1
ggplot2: sub/super-script axes labels
How are sub/superscripts designated for text in axis labels? As in this y-axis label: scale_y_continuous("Respiration, pmol O2 h-1") where the "2" needs to be subscripted and the "-1" needs to be superscripted. Thanks. Adam --------------------------------------------------- Adam G. Marsh, Ph.D. Associate Professor Marine Biological Sciences University of Delawar...
2012 Dec 12
1
Problems with plot maps
...ata[cshp.data$COWCODE==369,] map_mp<- list( geom_polygon(aes(long, lat, group = group), data = map, fill = "grey70", colour = "grey60", inherit.aes = FALSE, show_guide = FALSE), scale_x_continuous("", breaks = NULL, expand = c(0.02, 0)), scale_y_continuous("", breaks = NULL, expand = c(0.02, 0))) ggplot()+map_mp but I have such error "Error in recordGraphics(drawGTree(x), list(x = x), getNamespace("grid")) : invalid graphics state" What am I doing wrong?
2012 Nov 07
1
change colour of geom_step by scale_colour_manual
...king] library(ggplot2) ggplot(qry_r3_AFF0_CumRate_pooled[qry_r3_AFF0_CumRate_pooled$trt_label %in% c('ace','ctrlAM','met'),] , aes(x=AFF0, y=cum_rate_AFF0_pooled, group=trt_label))+ geom_step(aes(color=trt_label), direction="hv", size=5.0)+ scale_y_continuous("Rates of initiating first orientation flight", limits=c(0,0.6), expand=c(0,0), breaks=c(0,0.2,0.4,0.6)) + scale_x_continuous("Age of adults (days)", limits=c(0,16), expand=c(0,0), breaks=c(5, 10, 15)) + scale_colour_discrete(name ="Group",...
2009 Jul 23
1
Another question on gplot
I am getting following strange error : library(sn) library(ggplot2) dat1 <- as.matrix(rsn(1000, 0, 1, 0))[,1] ggplot() + geom_histogram(aes(x = dat1, y = ..density.., fill = ..count..)) + xlab("Distribution") + scale_y_continuous("") Error: No data for layer Can anyone please tell me why it is coming? -- View this message in context: http://www.nabble.com/Another-question-on-gplot-tp24624709p24624709.html Sent from the R help mailing list archive at Nabble.com.
2008 Mar 25
2
ggplot2 - facetting
...c('Class1', 'Class2', 'Class3', 'Class4')))) plotdata2 <- plotdata2[order(plotdata2[,'group']),] plot0<-ggplot() layer1<-layer(data=plotdata2, mapping=aes_string(x='x',y='y'),geom='point', stat='identity') scaleY<-scale_y_continuous() scaleX <- scale_x_continuous() Facets<-facet_grid(group ~ .) plot1<-plot0+layer1 +scaleY + scaleX + facet_grid(group~.) plot1 I always get the error message: Error in check_formula(formula, varnames) : Formula contains variables not in list of known variables Thanks for any help...