[R] Varying x-axes ticks

Spencer Graves spencer.graves at pdf.com
Tue Dec 28 20:53:45 CET 2004

      Please consider the following: 

plot(0:1, axes=F)

      If you read the help page for "axis" and work the examples there, 
you may be able to figure it out.  Hint:  Develop a function, say, fn, 
to shrink 25-104 to 25-50 leaving x < 25 unchanged.  Then the following 
should work for you: 

plot(fn(x), y, axes=F) # where x and y are the numbers you want to plot. 
axis(1, fn(xlabs), xlabs) # where xlabs = numbers for which you want 
tick marks and labels

      I did NOT TEST this particular piece of code, but I've done things 
like this in the past, and they worked. 

      hope this helps. 
      spencer graves

Anthony Gichangi wrote:

>Dear R Users,
>I have the following situations to plot. 
>x-values (times)      :  range from 0 to 104           (in weeks)
>y-values (hazards)  :  range from 0 to  0.5
>Now I want to make a plot of time versus hazards such
>that  in the time axis (i.e x-axis) the values 0-24 occupies
>half of the axis and the values 25-104 ocupies the rest
>of the axis. 
>In other words I want to emphasize on first 24 weeks so that
>the features of the hazard are more pronounced for these 
>Anybody with ideas how I can accomplish this ?
>Thanks in advance
>With kind regards
>	[[alternative HTML version deleted]]
>R-help at stat.math.ethz.ch mailing list
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Spencer Graves, PhD, Senior Development Engineer
O:  (408)938-4420;  mobile:  (408)655-4567

More information about the R-help mailing list