From: Duncan Murdoch <murdoch_at_stats.uwo.ca>

Date: Thu 07 Jul 2005 - 06:02:42 EST

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jul 07 06:10:44 2005

Date: Thu 07 Jul 2005 - 06:02:42 EST

On 7/6/2005 3:36 PM, Michael Friendly wrote:

> 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:
**>
**> http://euclid.psych.yorku.ca/SCS/Gallery/images/log-timeline.gif
**>
**> 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:
**> http://euclid.psych.yorku.ca/SCS/Gallery/milestone/Test/mileyears1.gif
**>
**> Some initial code to do a standard density plot looks like this:
**>
**> mileyears <- read.csv("mileyears3.csv", skip=1,
**> col.names=c("key","year","where","add","junk"))
**> mileyears <- mileyears[,2:4]
**>
**> years <- mileyears$year
**> years1500 <- years[years>1500]
**> dens <- density(years1500, from=1500, to=1990)
**> plot(dens)
**> rug(years1500)
**>
**> 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.
*

I think you'll have to do everything explicitly. That is, something like this:

labels <- pretty(years1500)

labels <- labels[labels<2000]

axis(1, labels, at=log(2000-labels))

minorticks <- pretty(years1500, n=20)

minorticks <- minorticks[minorticks<2000]
axis(1, labels=FALSE, at=log(2000-minorticks), tcl=-0.25)

axis(2)

box()

Duncan Murdoch

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jul 07 06:10:44 2005

*
This archive was generated by hypermail 2.1.8
: Fri 03 Mar 2006 - 03:33:18 EST
*