Dear R Community, I recently read an article and found a plot as attached. It has scatterplot, barplot, and error bar. Could anyone help me to figure out what package I can use in R to generate such plot? Thank you very much for any inputs! Kind regards, Ace -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2018-02-04 at 6.38.14 AM.png Type: image/png Size: 36795 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20180204/277012d7/attachment.png>
Hi Ace,
You can do it with plotrix:
library(plotrix)
barpos<-barp(c(1,5,38),width=0.5,col=c("white","lightgray","darkgray"),ylim=c(0,70))
ehplot(c(1,0.8,0.9,0.8,1.1,1,4,3,5,14,3,2,32,27,33,30,50,61),
c(1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3),median=FALSE,add=TRUE,cex=2,
pch=21,bg="white")
dispersion(barpos$x,barpos$y,c(0.1,1,5),lwd=2,arrow.cap=0.03)
lines(c(barpos$x[2],barpos$x[2],barpos$x[3],barpos$x[3]),c(18,63,63,62))
lines(c(barpos$x[1],barpos$x[1],barpos$x[3],barpos$x[3]),c(4,66,66,65))
text(2,68,"**",cex=2)
text(2.5,64.5,"**",cex=2)
Jim
On Mon, Feb 5, 2018 at 8:56 AM, Fix Ace via R-help <r-help at
r-project.org> wrote:> Dear R Community,
> I recently read an article and found a plot as attached. It has
scatterplot, barplot, and error bar. Could anyone help me to figure out what
package I can use in R to generate such plot?
> Thank you very much for any inputs!
> Kind regards,
> Ace
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Hi, JIm,
Thank you so much! Such a convenient tool!
A.
On Sunday, February 4, 2018 9:59 PM, Jim Lemon <drjimlemon at
gmail.com> wrote:
Hi Ace,
You can do it with plotrix:
library(plotrix)
barpos<-barp(c(1,5,38),width=0.5,col=c("white","lightgray","darkgray"),ylim=c(0,70))
ehplot(c(1,0.8,0.9,0.8,1.1,1,4,3,5,14,3,2,32,27,33,30,50,61),
c(1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3),median=FALSE,add=TRUE,cex=2,
pch=21,bg="white")
dispersion(barpos$x,barpos$y,c(0.1,1,5),lwd=2,arrow.cap=0.03)
lines(c(barpos$x[2],barpos$x[2],barpos$x[3],barpos$x[3]),c(18,63,63,62))
lines(c(barpos$x[1],barpos$x[1],barpos$x[3],barpos$x[3]),c(4,66,66,65))
text(2,68,"**",cex=2)
text(2.5,64.5,"**",cex=2)
Jim
On Mon, Feb 5, 2018 at 8:56 AM, Fix Ace via R-help <r-help at
r-project.org> wrote:> Dear R Community,
> I recently read an article and found a plot as attached. It has
scatterplot, barplot, and error bar. Could anyone help me to figure out what
package I can use in R to generate such plot?
> Thank you very much for any inputs!
> Kind regards,
> Ace
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]