Re: [R] Numbers as Points in Graphs

From: hippie dream <tonightsthenight_at_gmail.com>
Date: Sun, 06 Jul 2008 16:33:11 -0700 (PDT)

Actually Ted,

Mark's code worked perfectly although I am not really sure why. I am fairly confused by Ted'scode anyways, even though I'm sure it is right. Here is what it amounted to for my case:

plot(Length ~ Width, data=infiltration1, col="blue", xlab = "Width (cm)", ylab = "Length (m)", xlim=c(0,200), ylim=c(0,30), type="n") text(infiltration1$Width, infiltration1$Length, infiltration1$Bag.Number)

I don't really understand why I am specifying the x.y coordinates twice. Also is it always the third component of the text argument that specifies the point "label"? Anyways, if anyone is inclined I love a little explanation of this. Otherwise, thanks for the help.

Ted.Harding-2 wrote:

> 
> I think what he is trying to do is more on the following lines:
> 
> D<-NULL; for(i in (1:5)){D<-cbind(D,2.5*i+(0:10)+ 0.5*rnorm(11))}
> {plot((0:10),D[,1],pch=49,col="blue",ylim=c(0,25))}
> for(i in (2:5)){points((0:10),D[,i],pch=(48+i),col="blue")}
> 
> Ted.
> 
> On 06-Jul-08 22:47:49, milton ruser wrote:

>> Hi Hippien Dream
>>
>> If I understood, the code below may help you.
>>
>> Cheers,
>>
>> Miltinho Astronauta
>> Brazil
>> ===
>>
>>
>>
>> x<-runif(20)
>> y<-rnorm(20)
>>
>> df<-data.frame(cbind(x,y))
>>
>> par(mfrow=c(1,2))
>> plot(y~x, data=df)
>>
>> plot(y~x, data=df, type="n")
>> text(df$x, df$y, "o.o")
>>
>>
>>
>>
>>
>>
>> On 7/6/08, hippie dream <tonightsthenight_at_gmail.com> wrote:
>>>
>>>
>>> I am trying to produce a simple plot where the points in the plot are
>>> actually integers from my data. That is, I am making a length/width
>>> plot
>>> and
>>> I would like the points, rather dots or triangles, appear as different
>>> numbers corresponding to a column in my data. I have tried using this:
>>>
>>> ...,pch="column title"
>>>
>>> but this merely returns the first letter of the column title, B. Is
>>> there
>>> any way to do this?
>>>
>>> I am using R 2.7.1 and Ubuntu 8.04. Thanks.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Numbers-as-Points-in-Graphs-tp18307460p18307460.h
>>> tml
>>> 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.
>>>

>>
>> [[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.
> 
> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <Ted.Harding_at_manchester.ac.uk>
> Fax-to-email: +44 (0)870 094 0861
> Date: 07-Jul-08                                       Time: 00:22:14
> ------------------------------ XFMail ------------------------------
> 
> ______________________________________________
> 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/Numbers-as-Points-in-Graphs-tp18307460p18307904.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.
Received on Sun 06 Jul 2008 - 23:39:23 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 07 Jul 2008 - 00:31:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive