這是我使用基本圖形炮製了(之前我ggplot2
天):
## data
N <- 10
dnow <- data.frame(x=1:N, y=runif(N), labels=paste("This is \nobservation ",1:N))
## make margins wide
par(mfrow=c(1,1), mar=c(10,10,6,4))
## plot without axix labels or ticks
with(dnow, plot(x,y, xaxt="n", xlab=""))
## the positions we ant to plot
atn <- seq(1,N,3)
## the label for these positions
lab <- dnow$labels[atn]
## plot the axis, but do not plot labels
axis(1, at=atn, labels=FALSE)
## plot labels
text(atn, ## x position
par("usr")[3]-.05, ## position of the low axis
srt=45, ## angle
labels=lab, ##labels
xpd=TRUE, ## allows plotting outside the region
pos=2)
## par("usr")[3]
你是什麼意思2行?你的意思是你想要「這是\ n觀察......」嗎? – 2009-09-08 17:52:13
@chis_dubois這是答案的第一部分!謝謝! – 2009-09-08 18:13:43