@ForrestRStevens對我來說太快了,我太忙了嘗試使用花:)
## estimate curve
x <- seq(-1,1.5,0.1);
y <- c(1.3,1.32,1.33,1.32,1.25,1.1,0.7,0.5,0.4,0.38,0.4,0.41,0.42,0.43,0.44,0.4,0.3,0.1,0,-0.05,-0.1,-0.15,-0.2,-0.24,-0.28,-0.3);
f <- splinefun(x,y);
## calculate precise points along estimated curve
x <- seq(-1,1.5,0.01);
y <- f(x);
## precompute limits
xlim <- c(min(x),max(x));
ylim <- c(min(y)-0.4,max(y)+0.2);
## set global plot params
par(xaxs='i',yaxs='i',mar=c(1,1,3,3)+0.1); ## "internal" axis spacing, meaning no extended range, and slightly adjust margins
## draw plot
plot(NA,xlim=xlim,ylim=ylim,axes=F,ann=F); ## set plot bounds, no default ornaments
arrows(c(0,xlim[1]),c(ylim[1],0),c(0,xlim[2]),c(ylim[2],0),0.05); ## draw custom axes
mtext('y',3,1,at=0,las=1,cex=0.8,family='serif'); ## y label
mtext('x',4,1,at=0,las=1,cex=0.8,family='serif'); ## x label
lines(x,y,col='#aaaacc'); ## draw line on top
一般估計你的曲線,你可以用圖形基地繪製幾乎任何東西,但是與使用更復雜的軟件包相比,這通常更爲複雜,因爲您必須手工繪製所有內容。
R不喜歡製作這樣的情節。你可以用'plot(...,axes = FALSE)關掉所有的軸,然後你可以用'lines()'或者'segments()'來繪製你自己的行,或許使用' LWD ='。如果你真的提供了一個[可重現的例子](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)和一些數據一起玩,它會更容易回答和你打算使用的繪圖軟件包,如果不是基於R. – MrFlick
實際上你可以用'axis(...,pos = 0)'輕鬆地做到這一點,如果你真的想要箭頭,那麼其他答案可以給你那個'plot (x,y,xlim = c(-1.5,1.5),ylim = c(-2,2),axes = FALSE,ann = FALSE,type ='n');軸(1L,pos = 0,lwd.ticks = 0,labels = FALSE);軸(2L,pos = 0,lwd.ticks = 0,labels = FALSE);行(x,y,col = 4L)' – rawr