Skip to content
Prev 73077 / 398498 Next

plotting on a reverse log scale

Thanks Duncan,
That is almost exactly what I want, except I want time to
go in the normal order, not backwards, so:

# plot on reverse log scale
years1500 <- runif(500, 1500, 1990)  # some fake data
x <- -log(2000-years1500)
from <- -log(2000-1990)
to <- -log(2000-1500)
plot(density(x, from=from, to=to), axes=F)
rug(x)

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()

-Michael
Duncan Murdoch wrote: