search for: yintercept

Displaying 20 results from an estimated 32 matches for "yintercept".

Did you mean: intercept
2011 May 28
1
ggplot pale colors
...t;), Detail = c( "b", "c", "1", "2"), resp = runif(4, min = 0.5, max = 1)) ggplot(dataset, aes(x = Detail, y = resp)) + facet_grid(.~Main, scales = "free_x")+ geom_point(aes( size=6,shape = c(16,16,15,15) ),colour="blue")+geom_hline(aes(yintercept=0.25),colour='blue', size=2) with this code all the point are blue (like the line below) But if i try the following code, where my goal is to have the point on the left blue and the one on the right red, a problem appears: dataset <- data.frame(Main = c("A", "A&quot...
2011 Jan 18
2
ggplot2, geom_hline and facet_grid
...31.1550 9 CBP05J02 SINUS 31.8350 30.7000 10 CBP05J02 SINUS 34.0450 33.4800 11 CBP05J02 SINUS 31.3975 29.8150 > qplot((variable_time + fixed_time)/2, variable_time - fixed_time, data=lvexs) + facet_grid(ecd_rhythm ~ .) + geom_hline(yintercept=0) If I take out the geom_hline I get the plots I would expect. It doesn't seem to make any difference if I get the mean and difference separately. Can anyone explain this and tell me how to avoid it (and why does it work with the Diamonds data set? Any help much appreciated - thanks. Sand...
2023 Oct 30
1
Missing shapes in legend with scale_shape_manual
...ze = 3) + geom_point(aes(x = Date, y = bg, shape = missed_meds), alpha = 0) + #Invisible point layer for shape mapping scale_y_continuous(name = "Blood glucose (mg/dL)", breaks = seq(100, 230, by = 20) ) + geom_hline(yintercept = 130) + scale_shape_manual(name = "Conditions", labels = c("Missed meds", "Missed exercise"), values = c(20, 4), ## size = 3 ) However, t...
2013 Jan 08
2
plot residuals per factor
Dear R-users, I want to plot residuals vs fitted for multiple groups with ggplot2. I try this code, but unsuccessful. library("plyr") models<-dlply(dat1,"d",function(df) mod<-lm(y~x,data=df) ggplot(models,aes(.fitted,.resid), color=factor(d))+ geom_hline(yintercept=0,col="white",size=2)+ geom_point()+ geom_smooth(se=F) -- --- Catalin-Constantin ROIBU Forestry engineer, PhD Forestry Faculty of Suceava Str. Universitatii no. 13, Suceava, 720229, Romania office phone +4 0230 52 29 78, ext. 531 mobile phone +4 0745 53 18 01...
2012 Jul 03
2
ggplot2: legend
...y = y)) p + geom_point(aes(colour="Observations", shape="Observations")) + stat_summary(aes(colour = "Means", shape ="Means"), fun.y = mean, fun.ymin = min, fun.ymax = max, geom = "point") + geom_hline(aes(yintercept = mean(y), linetype = "Overall Mean"), show_guide = TRUE) I tried to map the linetype in geom_point (and stat_summary) to NULL and I tried to set it to "blank" but neither worked. Is it furthermore possible to combine the two legends? My preferred plot would have two symbols w...
2010 Jun 10
1
Order labels in qplot() - ggplot2 {help}
..."a", "b", "c") p <- c(2, 2,1, 3,5) pm<- c(3,4,2,5,4) pn <- c(1,1,1,2,3) x<-data.frame(cbind(n,p,pm,pn)) library(ggplot2) qplot(x=n, y=p, data=x, ymin=pn, ymax=pm, xlab='', ylab='', main='Order Label as: va vp a b c') + geom_hline(yintercept = 2) + geom_linerange() + coord_flip() Thanks! [[alternative HTML version deleted]]
2009 Feb 03
1
Time series plots with ggplot
Hi, I am newbie user of ggplot and would like some assistance in implementing time series plots. I'd like to know how the tsdiag plot can be made in ggplot? Thanks Harsh Singhal Decisions Systems, Mu Sigma Inc.
2011 May 16
1
Inverse autocorrelation fonction
...(acfth),Lag=as.numeric(names(acfth))) ci <- 0.95 climy <- qnorm((1 + ci)/2) / sqrt(artest$n.used) ###Computing significativity levels q2 <- qplot(Lag, IACF, data = base, yend = 0, xend = Lag, geom="bar",stat="identity",fill=I("Darkblue"))+theme_bw()+geom_hline(yintercept=c(-climy,climy),colour="red",linetype="dashed")+opts(title=expression(paste("Inverse autocorrelogram of ",y[t])),plot.title = theme_text(size = 25))+geom_hline(yintercept=0) q2 Hope this can help somebody JB Lepetit -- View this message in context: http://r.789...
2012 Aug 08
1
ggplot2 with separate average lines
...ge". > library(ggplot2) > data <- read.table("mem.dat", header=T, sep=",") > attach(data) > ggplot(data.frame(Type, ID, Size), aes(x=ID, y=Size, shape=Type, color=Type)) + geom_point(shape=1) + scale_fill_hue(l=40) + geom_line(stat="hline", yintercept=mean, linetype="dashed") > Regards, Alan [[alternative HTML version deleted]]
2023 Oct 31
0
Missing shapes in legend with scale_shape_manual
...e like this: ggplot(data = b2, aes(x = Date, y = bg)) + geom_line() + geom_point(aes(shape = medStat), size = 3)+ geom_point(aes(shape = exercise),size = 3)+ scale_y_continuous(name = "Blood glucose (mg/dL)", breaks = seq(100, 230, by = 20) ) + geom_hline(yintercept = 130) + scale_shape_manual(name = "Conditions", labels = c("Missed meds", "Missed exercise"), values = c(20, 4) ) Note that this method then gets very close without the scale_shape_manual,...
2017 Sep 26
2
Adding non-data line to legend ggplot2 Maximum Contaminant Level
...ot(data = MyData, aes(x=Year, y=Chloride , col=Detections)) + geom_point(aes(shape=Detections)) + #sets the detect vs. non-detect colors scale_colour_manual(values=c("black","red")) + #sets the y scale and log base 10 scale_y_log10() + ##adds line geom_hline(aes(yintercept=250),linetype="dashed")+ #location of the legend theme(legend.position=c("right")) + #sets the line color, type and size geom_line(colour="black", linetype="dotted", size=0.5) + ylab("Chloride (mg/L)") ## does the graph using the Locati...
2023 Oct 31
0
Missing shapes in legend with scale_shape_manual
...(x = Date, y = bg)) + > ? geom_line() + > ? geom_point(aes(shape = medStat), size = 3)+ > ? geom_point(aes(shape = exercise),size = 3)+ > ? scale_y_continuous(name = "Blood glucose (mg/dL)", > ???????????????????? breaks = seq(100, 230, by = 20) > ? ) + > ? geom_hline(yintercept = 130) + > ? scale_shape_manual(name = "Conditions", > ???????????????????? labels = c("Missed meds", > ??????????????????????????????? "Missed exercise"), > ???????????????????? values = c(20, 4) > ? ) > > > Note that this method then gets ve...
2010 Oct 19
3
plot CI and mortality rate
Dear R Users: I have the individual mortality rate and 95% CI of 100 hospitals, how to do the plot with the individual hospital in the Yaxis, and the mortality rate and 95% CI in the Xais and a overall mean as a reference line? Thanks and regards, Xin [[alternative HTML version deleted]]
2012 Feb 01
1
ggplot2(0.9.0): could not find function "=="
...= "identity") + + xlab("") + scale_y_continuous("Export - Import", + formatter = "comma") Error in continuous_scale(c("y", "ymin", "ymax", "yend", "yintercept", : unused argument(s) (formatter = "comma") > ggplot(trade.m, aes(Time)) + geom_bar(subset = .(variable == + "EXP"), aes(y = value, fill = BEC), stat = "identity") + + geom_bar(subset = .(variable == "IMP"), + aes(y = -value,...
2013 May 14
1
Tamaño plots y calidad en grafico ggplot
...)) 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")+ geom_vline(xintercept = -2, linetype=1, colour="white")+ geom_vline(xintercept = k, colour="#0000FF20", lwd=5)+ geom_rect(xmin=-2,xmax=...
2013 Oct 11
1
behaviour of read.xls (gdata package) when worksheet usesuser-defined cells formats
(I'm afraid this post didn't reach the list on last Wednesday, here it is again ) hi R-list, And sorry for my frenglish ! I am running R < Good Sport > release ( i386-w64-mingw32/i386 (32-bit) ) ) under Windows 7 Professional, Service Pack 1. My perl executable is ActivePerl build 817 [257965] (i.e. version 5.8.8.817). Usually it is working fine. Using the gdata ::read.xls
2013 Sep 18
1
ggplot2: changing strip text in facet_grid and a legend text problem
...t;summary", fun.y = "mean", mapping=aes(linetype=organism, group=organism))+ #must add jitter if using this geom_point(stat="summary", fun.y = "mean", size=2, mapping=aes(shape=organism))+ scale_shape(solid = FALSE) + #must be unfilled geom_hline(yintercept=0, linetype=3) + #draws dotted line at 0 theme(strip.text.x = element_text(size = 16, colour="black", family="serif", angle=00)) + theme(strip.text.y = element_text(size = 16, colour="black", family="serif", angle=00)) + theme(axis.text.x = element_text...
2017 Aug 05
2
Nested for loop
...t;scales")) {install.packages("scales"); require("scales")} small.sample.dat <- schnabel.comp small.sample <- ggplot(data = small.sample.dat, mapping = aes(x = sample, y = pop.estimate)) + geom_point(size = 2) + geom_line() + geom_hline(yintercept = N, col = "red", lwd = 1) + coord_cartesian(xlim = c(0:100), ylim = c(300:500)) + scale_x_continuous(breaks = pretty_breaks(11)) + scale_y_continuous(breaks = pretty_breaks(11)) + labs(x = "\nSample", y = "Population estimate\n", title = "Sample si...
2010 Apr 30
0
ggplot2 legend how?
...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' and beta_1") + opts(legend.position = c(10,2.5)) Many thanks in advance, Best regards, Giovanni [[alternative HTML version deleted]]
2017 Oct 01
0
Adding non-data line to legend ggplot2 Maximum Contaminant Level
...ot(data = MyData, aes(x=Year, y=Chloride , col=Detections)) + ? geom_point(aes(shape=Detections)) + ? #sets the detect vs. non-detect colors ? scale_colour_manual(values=c("black","red")) + ? #sets the y scale and log base 10 ? scale_y_log10() + ? ##adds line ? geom_hline(aes(yintercept=250),linetype="dashed")+ ? #location of the legend ? theme(legend.position=c("right")) + ? #sets the line color, type and size ? geom_line(colour="black", linetype="dotted", size=0.5) + ? ylab("Chloride (mg/L)") ## does the graph using the Locati...