[R] plotting on a reverse log scale

Michael Friendly friendly at yorku.ca
Wed Jul 6 21:36:03 CEST 2005

I'd like to do some plots of historical event data on a reverse log 
scale, started, say at the year 2000 and going
backwards in time, with tick marks spaced according to log(2000-year).  
For example, see:


As an example, I'd like to create a density plot of such data with the 
horizontal axis reverse-logged,
a transformation of this image:

Some initial code to do a standard density plot looks like this:

mileyears <- read.csv("mileyears3.csv", skip=1, 
mileyears <- mileyears[,2:4]

years <- mileyears$year
years1500 <- years[years>1500]
dens <- density(years1500, from=1500, to=1990)

I could calculate log(2000-year), but I'm not sure how to do the 
plotting, do some minor tick marks
and label the major ones, say at 100 year intervals.



Michael Friendly     Email: friendly at yorku.ca 
Professor, Psychology Dept.
York University      Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Street    http://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA

More information about the R-help mailing list