search for: geom_errorbar

Displaying 20 results from an estimated 52 matches for "geom_errorbar".

2011 Feb 17
3
ggplot2, 'se' variable in geom_errorbar's limits?
Dear R-list I'm working with with geom_errorbar; specifically I'm trying to reproduce the example Hadley Wickham have on http://had.co.nz/ggplot2/geom_errorbar.html (all in the button of the page) where he makes an nice plot with errorbars and then draw lines between the points. What confuses me is the 'limits' he defines for the er...
2007 Oct 03
1
ggplot2: problem with geom_errorbar and geom_abline
...works but the error bars have an undesirable line drawn between the left edges of the caps. Does anyone know how to change this behavior? I am using R version 2.5.1 and ggplot2 version 0.5.5 on Ubuntu Feisty. Thanks for your help. James ## I am using an example from http://had.co.nz/ggplot2/geom_errorbar.html library(ggplot2) df <- data.frame( trt = factor(c(1, 1, 2, 2)), resp = c(1, 5, 3, 4), group = factor(c(1, 2, 1, 2)), se = c(0.1, 0.3, 0.3, 0.2)) ## The following three lines work fine and produce the same graphic as seen on the example website limits <- aes(max = re...
2010 Nov 04
5
ggplot output
Dear All, I have this script: dat <- data.frame(Month = hstat$Date,C_avg = hstat$C.avg,C_stdev = hstat$C.stdev) ggplot(data = dat, aes(x = Month, y = C_avg, ymin = C_avg - C_stdev, ymax = C_avg + C_stdev)) + geom_point() + geom_line() + geom_errorbar() dat <- data.frame(Month = hstat$Date,K_avg = hstat$K.avg,K_stdev = hstat$K.stdev) ggplot(data = dat, aes(x = Month, y = K_avg, ymin = K_avg - K_stdev, ymax = K_avg + K_stdev)) + geom_point() + geom_line() + geom_errorbar() dat <- data.frame(Month = hstat$Date,S_avg = hstat$S.avg...
2010 May 01
1
ggplot2's geom_errorbar legend
Hello, I create a simple ggplot that only shows a straight line. I then add three datasets of CI using the geom_errorbar function. The problem is that I can't find any way to have the legend showing up ... I need to show what each color of the CIs corresponds to i.e. which method. Can anyone advice please? TIA, Best regards, Giovanni
2008 Jun 16
1
ggplot2: How to remove legend component for geom_errorbar() ?
...robably Hadley), I'm trying to do a plot like the following, composed of bars and error bars: df <- data.frame(factor1=gl(2,5), factor2=gl(5,1), y=rnorm(10), err=0.1) ggplot(df, aes(x=factor1, y=y, fill=factor2)) + geom_bar(position="dodge", stat="identity") + geom_errorbar(aes(min=y-err, max=y+err), position="dodge", width=0.1) The plot obtained has a legend named "factor2", giving as expected the colours used for the five factor levels of factor2. So far so good. However, the legend also contains solid horizontal lines, obviously representing th...
2012 Jul 26
2
Error Bars ggplot2
...quot;) r<-c(4.9,3.2,2.1,.2,3.8,6.4,7.5,1.7,3.4,4.1,2.2,5) #Turn spd into a factor spd.f<-factor(spd) #Place data into a data frame data<-data.frame(cbind(spd.f,r)) #Load ggplot2 library(ggplot2) #Create plot pd<-position_dodge(.2) myplot<-ggplot(data,aes(x=spd,y=r,colour=spd))+ geom_errorbar(aes(ymin=3,ymax=5),width=.1)+ geom_point()+ geom_errorbar(aes(ymin=1,ymax=6),width=.1,colour="black",position=pd) #Display plot myplot I have attached a plot that my sample code produces. As you can see the error bars are stacked. How can I get them to plot side by side? Thanks A...
2010 Mar 12
1
simple plot in ggplot2, wrong error bars
I was wondering if anyone could help me with this, simple problem. I am essentially following the example on Hadley's webpage (http://had.co.nz/ggplot2/geom_errorbar.html), but it still doesn't make any sense to me. df <- data.frame(trt = factor(c("intact", "intact", "removed", "removed")), coon = c(0.093, 0.06, 0.057, 0.09), group = factor(c("veget", "fruit", "veget", "fruit&q...
2007 Oct 13
1
geom_errorbar with ggplot2
Dear All, I am trying to build an error bar plot with ggplot2. However, even if the code seems to work, the plot is rather odd, with what seems to be a continuous line linking the different bars. I attach below the code I used, as well as the data. ================================================================ DFrame<-data.frame(x=1:10,y=0.5*(1:10),Upper=(1:10)+0.5, Lower=(1:10)-0.5) p
2010 Oct 27
3
ggplot - unwanted sorted X values
Hi, I have this script: dat <- data.frame(X = halistat$Date,Y1 = halistat$avg,Y2 = halistat$stdev) ggplot(data = dat, aes(x = X, y = Y1, ymin = Y1 - Y2, ymax = Y1 + Y2)) + geom_point() + # points at the means geom_line() + # if you want lines between pints geom_errorbar() # error bars, Y1 - Y2 and Y1 + Y2 halistat$Date values: 29/1/10 21/2/10 30/3/10 30/4/10 30/5/10 In the resulted plot the X values are sorted, how can I cancel it? Thanks. -- View this message in context: http://r.789695.n4.nabble.com/ggplot-unwanted-sorted-X-values-tp3015099p3015099.html...
2013 Feb 03
1
ggplot2 plotting errorbars.
Hi, i'm using this lines of code: dodge <-position_dodge(width=0.9) ggplot(dfm,aes(x = X,y = value)) + geom_bar(aes(fill = variable), position=dodge, stat="identity") + geom_errorbar(aes(ymin=value-er, ymax=value+er),width=0.25, position=dodge,stat="identity") to plot this data frame X variable value er 1 A X4 58.74 9.44 2 B X4 52.41 10.01 3 C X4 95.52 4.88 4 A X1 75.51 8.54 5 B X1 0.73 23.20 6 C X1 96.66...
2010 Dec 13
1
ggplot2 errorbarh
Hi, I'm having problems using the 'width' aesthetic attribute for the geom_errorbarh. This is the same problem reported earlier here, but I'll try to write the problem more clearly: http://www.mail-archive.com/r-help@r-project.org/msg62371.html The problem I'm having is that, the 'width' attribute is supposed to set the height of the endpoints of the whiskers,...
2013 Mar 06
6
Ggplot2: Moving legend, change fill and removal of space between plots when using grid.arrange() possible use of facet_grid?
...factor1, shape = factor1)) + geom_point(aes(shape=factor(factor1)), color="black", fill="white", position = "dodge", width = 0.3, size=3) + geom_line(aes(linetype=factor1), color = "black", size = 0.5) + geom_errorbar(aes(ymin = mean - sdv , ymax = mean + sdv), width = 0.3, position = "dodge", color = "black", size=0.3) + theme_bw() + ylab(expression(paste("my measured stuff"))) + xlab("factor3") + ggtitle("") + labs(color = "facto...
2011 Sep 07
2
ggplot2-Issue placing error bars behind data points
...0.030400 1.25 0.904000 8 0.047100 1.50 0.911000 8 0.072200 limits<-aes(ymax=NerveSurv$SAP+NerveSurv$SAPSE,ymin=NerveSurv$SAP-NerveSurv$SAPSE) p<-ggplot(data=NerveSurv,aes(x=Time,y=SAP)) p+geom_point(aes(colour=factor(Temp), shape=factor(Temp), fill=factor(Temp)), size=4) +geom_errorbar(limits,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,2...
2011 Dec 04
1
Polishing my geom_bar for publication
...the right figure to avoid duplication, and (3) fix the width, such that both figures have the same apparence regardless of the legend. Thank you very much in advance! The code is as follow: (a<-ggplot(Final2, aes(x=spp, y=CPUE, fill=season)) + geom_bar(position=position_dodge()) + geom_errorbar(aes(ymin=CPUE-cpue.se, ymax=CPUE+cpue.se), size=.3, width=.2, position=position_dodge(.9)) + xlab("Species") + scale_x_discrete(breaks=c("100","102","107","88","90","91&quot...
2007 Jul 25
1
Ggplot2 equivalent of axis and problem with log scale
...n of the labels and the text of the labels? With a basic plot I would use axis(2, at = position.of.the.ticks, labels = text.at.the.ticks). Could someone provide me with an example of how to do this with ggplot2? The second question is probably a little bug. If I plot the y-axis in log10 scale then geom_errorbar still plot the values in the original scale. See the example below. The second plot is what I would suspect when plotting the first graph. library(ggplot2) df <- data.frame(x = rep(1:10, 10), y = rnorm(100)) df$y <- 10 ^ (df$x + df$y) df <- cbind(df, predict(lm(I(log10(y)) ~ x, data = df)...
2010 Apr 30
0
ggplot2 legend how?
...t;- rep(betas[p],S) data <- data.frame(x,y) classiclimits <- aes(x=x,ymax = classic[,e,p,1], ymin=classic[,e,p,2]) ownlimits <- aes(x=x+0.4,ymax = own[,e,p,1], ymin=own[,e,p,2]) rbootlimits <- aes(x=x+0.8,ymax = rboot[,e,p,1], ymin=rboot[,e,p,2]) g1 <- ggplot(data, aes(x, y)) g1 + geom_errorbar(classiclimits, colour = "red") + geom_errorbar(ownlimits, colour = "green") + geom_errorbar(rbootlimits, colour = "blue") + geom_hline(yintercept = betas[p]) + xlab("Simulation") + ylab("beta_1") + opts(title = "CI for error 'normal' a...
2013 Mar 07
3
ggpliot2: reordering of factors in facets facet.grid(). Reordering of factor on x-axis no problem.
...uot;, "B"), order=T) # plotting: ggplot(Summ, aes(factor3, mean, group = factor1, ymin = mean - sdv , ymax = mean + sdv)) + geom_point(position = position_dodge(width = 0.25), size = 3) + geom_line(position = position_dodge(width = 0.25)) + geom_errorbar(width = 0.3, position = position_dodge(width = 0.25), size = 0.3) + facet_wrap(~Grouping, ncol = 2) + theme(strip.background = element_blank()) + scale_shape(solid = FALSE)+ theme_bw() + ylab(expression(paste("my measured stuff"))) + xlab("factor3") + theme(legend...
2011 Mar 08
2
plotCI() with ggplot2
Hello Currently, I plot some coefficients with some intervals using function "plotCI()" (package "gplots") using the following code: (m1 <- matrix(0:5, nrow=2, byrow=T, dimnames=list(c("v1", "v2"), c("lo", "m", "hi")))) m2 <- m1 + 1 library(gplots) plotCI( x=1:length(m1[, 1]), pch="",
2009 Apr 27
1
plot estimates and their 95% confidence intervals
Hi, there: I have a dataset with 50 states and for each state, I have its associated mean estimate (for some parameters) and the lower and upper bound of the 95% CI. The data look like below: state ami_mean ami_low ami_up 1 MS -0.58630 -0.90720 -0.29580 2 KY -0.48100 -0.75990 -0.19470 3 FL -0.47900 -0.62930 -0.32130 I would like to have a plot the 95% CI (characterized by
2012 Sep 16
1
How to plot two lines, and only one line with errorbar by qqplots of R
...ta = c(mean.beta1, mean.beta2, mean.beta3), t = rep(points, 3), std.beta = c(std.beta1, std.beta2, std.beta3) ) limits = aes(ymin = mean.beta - std.beta, ymax = mean.beta + std.beta); maintitle = paste("beta function (std = ", std, ")", sep = ""); p + geom_line() + geom_errorbar(limits, width = 0.05) + ggtitle(maintitle) + theme(legend.title=element_blank(), legend.justification=c(0,1), legend.position=c(0,1))+ scale_x_continuous(breaks=seq(0, 10, .1)) + scale_y_continuous(breaks=seq(0, 13, .1)) + ylab("Beta(t)") + scale_colour_hue(breaks=c("Wrong&...