@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