I want to get the plot like this, http://n4.nabble.com/file/n1839303/%25E9%25A2%2591%25E7%258E%2587%25E5%2588%2586%25E5%25B8%2583%25E5%259B%25BE%25E6%25A0%2587%25E5%2587%2586.jpg %E9%A2%91%E7%8E%87%E5%88%86%E5%B8%83%E5%9B%BE%E6%A0%87%E5%87%86.jpg not this, http://n4.nabble.com/file/n1839303/R.jpg R.jpg and the data here, thank you! http://n4.nabble.com/file/n1839303/y1.txt y1.txt can R deal with this problem? how can I do? -- View this message in context: http://n4.nabble.com/how-can-I-plot-the-histogram-like-this-using-R-tp1839303p1839303.html Sent from the R help mailing list archive at Nabble.com.
Hi: On Tue, Apr 13, 2010 at 9:45 PM, bbslover <dluthm@yeah.net> wrote:> > I want to get the plot like this, > > http://n4.nabble.com/file/n1839303/%25E9%25A2%2591%25E7%258E%2587%25E5%2588%2586%25E5%25B8%2583%25E5%259B%25BE%25E6%25A0%2587%25E5%2587%2586.jpg > %E9%A2%91%E7%8E%87%E5%88%86%E5%B8%83%E5%9B%BE%E6%A0%87%E5%87%86.jpg >This plot requires that you create a factor whose levels are ordered as c(rep(0, 5, by = 0.1), 'More') and use barplot() to do the graph. To get the center line, use vline(). To specify the position and angle of the labels, consult ?axis, and make sure you use xaxt = 'n' to suppress the x-axis in the original plot. That's sufficient to get the gist of what you need to generate the plot above. The plot below was clearly produced with hist(), treating the x variable as numeric. Don't forget to consult the space = and beside = arguments of barplot(); it wouldn't hurt to run the examples, either... HTH, Dennis> > not this, http://n4.nabble.com/file/n1839303/R.jpg R.jpg > > and the data here, thank you! http://n4.nabble.com/file/n1839303/y1.txt > y1.txt > > can R deal with this problem? how can I do? > -- > View this message in context: > http://n4.nabble.com/how-can-I-plot-the-histogram-like-this-using-R-tp1839303p1839303.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > 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]]
Aer you asking how to have more bars on the axis ? That can be controlled using: barplot(stuff, br = 50) # br can be other numbers according to needs. The vertical line can be done with: abline(v=20) # You may change 20 There are other elements to the plot to reproduce, but is this enough for your needs? Tal ----------------Contact Details:------------------------------------------------------- Contact me: Tal.Galili@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) ---------------------------------------------------------------------------------------------- On Wed, Apr 14, 2010 at 7:45 AM, bbslover <dluthm@yeah.net> wrote:> > I want to get the plot like this, > > http://n4.nabble.com/file/n1839303/%25E9%25A2%2591%25E7%258E%2587%25E5%2588%2586%25E5%25B8%2583%25E5%259B%25BE%25E6%25A0%2587%25E5%2587%2586.jpg > %E9%A2%91%E7%8E%87%E5%88%86%E5%B8%83%E5%9B%BE%E6%A0%87%E5%87%86.jpg > > not this, http://n4.nabble.com/file/n1839303/R.jpg R.jpg > > and the data here, thank you! http://n4.nabble.com/file/n1839303/y1.txt > y1.txt > > can R deal with this problem? how can I do? > -- > View this message in context: > http://n4.nabble.com/how-can-I-plot-the-histogram-like-this-using-R-tp1839303p1839303.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > 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]]
thanks for your help. I can have a try. -- View this message in context: http://n4.nabble.com/how-can-I-plot-the-histogram-like-this-using-R-tp1839303p1839534.html Sent from the R help mailing list archive at Nabble.com.
thank you, I will try this function barplot. -- View this message in context: http://n4.nabble.com/how-can-I-plot-the-histogram-like-this-using-R-tp1839303p1839541.html Sent from the R help mailing list archive at Nabble.com.
There are several ways in which the picture you show is uglier than the histogram produced by R. Which of these do you want to accomplish and why? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of bbslover > Sent: Tuesday, April 13, 2010 10:46 PM > To: r-help at r-project.org > Subject: [R] how can I plot the histogram like this using R? > > > I want to get the plot like this, > http://n4.nabble.com/file/n1839303/%25E9%25A2%2591%25E7%258E%2587%25E5% > 2588%2586%25E5%25B8%2583%25E5%259B%25BE%25E6%25A0%2587%25E5%2587%2586.j > pg > %E9%A2%91%E7%8E%87%E5%88%86%E5%B8%83%E5%9B%BE%E6%A0%87%E5%87%86.jpg > > not this, http://n4.nabble.com/file/n1839303/R.jpg R.jpg > > and the data here, thank you! > http://n4.nabble.com/file/n1839303/y1.txt > y1.txt > > can R deal with this problem? how can I do? > -- > View this message in context: http://n4.nabble.com/how-can-I-plot-the- > histogram-like-this-using-R-tp1839303p1839303.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > 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.
Thanks for your reply, I just want to get the figure like y1.jpg using the data from y1.txt. Through the figure I want to obtain the split point like y1.jpg, and consider 2.5 as the plit point. This figure is drawn by other people, I just want to draw it using R, but I can not, so I hope, friends can help me. Best wishes! kevin http://n4.nabble.com/file/n1965378/y1.jpg http://n4.nabble.com/file/n1965378/y1.txt y1.txt -- View this message in context: http://n4.nabble.com/how-can-I-plot-the-histogram-like-this-using-R-tp1839303p1965378.html Sent from the R help mailing list archive at Nabble.com.
On Fri, Apr 16, 2010 at 10:13 AM, bbslover <dluthm at yeah.net> wrote:> > ?Thanks for your reply, I just want to get the figure like y1.jpg using the > data from y1.txt. > ?Through the figure ?I want to obtain the split point like y1.jpg, and > consider 2.5 as the plit point. ?This figure is drawn by other people, I > just want to draw it using R, but I can not, so I hope, friends can help me. > > Best wishes! > kevin http://n4.nabble.com/file/n1965378/y1.jpg > http://n4.nabble.com/file/n1965378/y1.txt y1.txt > -- > View this message in context: http://n4.nabble.com/how-can-I-plot-the-histogram-like-this-using-R-tp1839303p1965378.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > 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, Does this do what you want? temp<-read.table(url("http://n4.nabble.com/file/n1965378/y1.txt")) hist(temp$V1,breaks=seq(0,5.1,by=0.1)) abline(v=2.5,lty=2,lwd=2,col="red") Regards, Gustaf -- Gustaf Rydevik, M.Sci. tel: +46(0)703 051 451 address:Essingetorget 40,112 66 Stockholm, SE skype:gustaf_rydevik