File: getYmult.R

package info (click to toggle)
r-cran-plotrix 3.8-1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,580 kB
  • sloc: makefile: 6
file content (14 lines) | stat: -rw-r--r-- 285 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
getYmult<-function() {
 if(dev.cur() == 1) {
  warning("No graphics device open.")
  ymult<-1
 }
 else {
  # get the plot aspect ratio
  xyasp<-par("pin")
  # get the plot coordinate ratio
  xycr<-diff(par("usr"))[c(1,3)]
  ymult<-xyasp[1]/xyasp[2]*xycr[2]/xycr[1]
 }
 return(ymult)
}