Hi everyone, I want you all help me to give an idea, how to draw pentagon with points? Maybe can use function, but I'm stuck. Yhank you. -- Hemavathi Ramulu [[alternative HTML version deleted]]
Hemavathi Ramulu wrote:> Hi everyone, > I want you all help me to give an idea, how to draw pentagon with points? > Maybe can use function, but I'm stuck. > > Yhank you. > >Hi Hemavathi, Try these to draw, successively, points at the vertices of a pentagon, the outline of a pentagon and a filled pentagon. To rotate the pentagon, add the rotation in radians to the two sequences. xpos<-cos(seq(0,2*pi,by=2*pi/5)) ypos<-sin(seq(0,2*pi,by=2*pi/5)) plot(xpos,ypos,pty="s") lines(xpos,ypos) polygon(xpos,ypos,col="red") Jim
Hi r-help-bounces at r-project.org napsal dne 18.08.2009 06:13:09:> Hi everyone, > I want you all help me to give an idea, how to draw pentagon withpoints?> Maybe can use function, but I'm stuck.Maybe. Maybe you can use a pencil, instead. Basically this plot(1:10, type="n") polygon(c(2,3,5,6,4), c(5,3,3,5,7)) points(c(2,3,5,6,4), c(5,3,3,5,7)) will draw one of infinite number of pentagons. If you can establish a function for drawing any pentagon in any display with any range it would be more complicated and you probably need to study ?grDevices and ?par more thoroughly Regards Petr> > Yhank you. > > -- > Hemavathi Ramulu > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
Look at the my.symbols and ms.polygon functions in the TeachingDemos package. -- 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 Hemavathi Ramulu > Sent: Monday, August 17, 2009 10:13 PM > To: r-help at r-project.org > Subject: [R] how to draw pentagon? > > Hi everyone, > I want you all help me to give an idea, how to draw pentagon with > points? > Maybe can use function, but I'm stuck. > > Yhank you. > > -- > Hemavathi Ramulu > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.