Re: [R] how do R calculates the number of intervals between tick-marks

2010-08-25 Thread David Winsemius


On Aug 24, 2010, at 7:05 PM, Antonio Olinto wrote:


Hello,

I want to know how do R calculates the number of intervals between  
tick-marks in the y axis in a plot.


?axTicks # and then look at the other citations and the code as needed




I'm making a three y-axes plot and this information would help me a  
lot.


Thanks in advance.

Antonio Olinto


--

David Winsemius, MD
West Hartford, CT

__
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.


Re: [R] how do R calculates the number of intervals between tick-marks

2010-08-25 Thread Henrique Dallazuanna
Take a look at pretty function.

On Tue, Aug 24, 2010 at 8:05 PM, Antonio Olinto aolint...@bignet.com.brwrote:

 Hello,

 I want to know how do R calculates the number of intervals between
 tick-marks in the y axis in a plot.

 I'm making a three y-axes plot and this information would help me a lot.

 Thanks in advance.

 Antonio Olinto



 
 Webmail - iBCMG Internet
 http://www.ibcmg.com.br

 __
 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.




-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40 S 49° 16' 22 O

[[alternative HTML version deleted]]

__
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.


Re: [R] how do R calculates the number of intervals between tick-marks

2010-08-25 Thread Antonio Olinto

Hi,

With axTicks I did what I wanted. Thank you all for the attention.

Below is the code I did to have a plot with three y axes.

Suggestions to improve the routine are welcome.

All the best,

Antonio Olinto

Data in a spreadsheet

YEARL   NFB NFT
200526,352158   150025,014
200632,514789   210035,024
200727,458126   180030,254
200828,568971   150043,254
200932,564789   300060,32

# comma is a decimal symbol

dat.lnbnt - read.delim(clipboard,dec=,,header=T)

attach(dat.lnbnt)
summary(dat.lnbnt)
  YEARL  NFBNFT
 Min.   :2005   Min.   :26.35   Min.   :1500   Min.   :25.01
 1st Qu.:2006   1st Qu.:27.46   1st Qu.:1500   1st Qu.:30.25
 Median :2007   Median :28.57   Median :1800   Median :35.02
 Mean   :2007   Mean   :29.49   Mean   :1980   Mean   :38.77
 3rd Qu.:2008   3rd Qu.:32.51   3rd Qu.:2100   3rd Qu.:43.25
 Max.   :2009   Max.   :32.56   Max.   :3000   Max.   :60.32

y1min - 26
y1max - 33
y1range - y1max-y1min
y2min - 1500
y2max - 3000
y2range - y2max-y2min
y3min - 25
y3max - 61
y3range - y3max-y3min

par(mar=c(6, 6, 2,12))
plot(L, ylim=c(y1min,y1max), ylab=landings (×1000 t),  
type=l,col=red,las=0, cex.axis=1.2,cex.lab=1.4,xaxt=n,xlab=)

points(y1range*((NFB-y2min)/y2range)+y1min,type=l,col=blue)
points(y1range*((NFT-y3min)/y3range)+y1min,type=l,col=darkgreen)

yticks - axTicks(2)
interval - yticks[2]-yticks[1]
divisions - length(yticks)-1

axis(1,at=axTicks(1),labels=as.character(YEAR),las=2,cex.axis=1.2)
axis(4,at=seq(y1min,y1max,interval),labels=as.integer(seq(y2min,y2max,y2range/divisions)),las=0,cex.axis=1.2)
axis(4,at=seq(y1min,y1max,interval),labels=as.integer(seq(y3min,y3max,y3range/divisions)),cex.axis=1.2,  
las=0,line=5)

mtext(nº of fishing boats,4,3,cex=1.4)
mtext(nº of fishing trips (×1000),4,8, cex=1.4)
legend(4,33,c(L,Nº FB,Nº  
FT),bty=n,lty=c(1,1,1),col=c(red,blue,darkgreen),cex=1.4)



Citando David Winsemius dwinsem...@comcast.net:



On Aug 24, 2010, at 7:05 PM, Antonio Olinto wrote:


Hello,

I want to know how do R calculates the number of intervals between  
tick-marks in the y axis in a plot.


?axTicks # and then look at the other citations and the code as needed




I'm making a three y-axes plot and this information would help me a lot.

Thanks in advance.

Antonio Olinto


--

David Winsemius, MD
West Hartford, CT







Webmail - iBCMG Internet
http://www.ibcmg.com.br

__
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.