Graphics question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Graphics question

Bowden, J.M.

Hi

I am trying to plot two points (with confidence intervals) on a graph to
illustrate the value of a particular quantity after 1 and 2 iterations
respectively.


I'm doing this by

plot(cycle,alpha[2,],main="",ylim=c(-8,-3),cex=2,col="red",pch=19,ylab=e
xpression(alpha),xlab="cycle")

Etc..

Where


> cycle
[1] 1 2
> alpha
          [,1]      [,2]
[1,] -6.227266 -5.762146
[2,] -5.200972 -5.010401
[3,] -4.174677 -4.258655


When I plot this I get the x-axis scale reading 1.0,1.1,1.2,...,2.0

I want to get it to read simply                 1                2


Is there an easy way to do this?

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphics question

Dimitris Rizopoulos
try the following:

plot(..., xaxt = "n")
axis(1, at = 1:2)

I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://www.med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


----- Original Message -----
From: "Bowden, J.M." <[hidden email]>
To: <[hidden email]>
Sent: Thursday, March 02, 2006 4:41 PM
Subject: [R] Graphics question


>
> Hi
>
> I am trying to plot two points (with confidence intervals) on a
> graph to
> illustrate the value of a particular quantity after 1 and 2
> iterations
> respectively.
>
>
> I'm doing this by
>
> plot(cycle,alpha[2,],main="",ylim=c(-8,-3),cex=2,col="red",pch=19,ylab=e
> xpression(alpha),xlab="cycle")
>
> Etc..
>
> Where
>
>
>> cycle
> [1] 1 2
>> alpha
>          [,1]      [,2]
> [1,] -6.227266 -5.762146
> [2,] -5.200972 -5.010401
> [3,] -4.174677 -4.258655
>
>
> When I plot this I get the x-axis scale reading 1.0,1.1,1.2,...,2.0
>
> I want to get it to read simply                 1                2
>
>
> Is there an easy way to do this?
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphics question

Prof Brian Ripley
In reply to this post by Bowden, J.M.
xaxp=c(1,2,1) will do so, and look also at par(lab=).

On Thu, 2 Mar 2006, Bowden, J.M. wrote:

>
> Hi
>
> I am trying to plot two points (with confidence intervals) on a graph to
> illustrate the value of a particular quantity after 1 and 2 iterations
> respectively.
>
>
> I'm doing this by
>
> plot(cycle,alpha[2,],main="",ylim=c(-8,-3),cex=2,col="red",pch=19,ylab=e
> xpression(alpha),xlab="cycle")
>
> Etc..
>
> Where
>
>
>> cycle
> [1] 1 2
>> alpha
>          [,1]      [,2]
> [1,] -6.227266 -5.762146
> [2,] -5.200972 -5.010401
> [3,] -4.174677 -4.258655
>
>
> When I plot this I get the x-axis scale reading 1.0,1.1,1.2,...,2.0
>
> I want to get it to read simply                 1                2
>
>
> Is there an easy way to do this?
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Loading...