Hi,

I'm having a bit of trouble with the axes in my plots. I don't like the way
R does not have them cross in the origin. Is there another plot/axis
function? i tried using abline as suggested by someone from this list, but
in my case this gives no satisfactory result, as the abline does sometimes
lie on top of the y axis and sometimes not, depending on how i scale the
image...

#bild16 umkehrfunktion
source("normpdf.r")
png("umkehrfunktion.png",width=18,height=18,units="cm",res=600,pointsize=16)
newdata=data.frame(x=seq(0,0.6*max(fit$df$x),length=200))
newy=predict(fit,newdata)
plot.new()
plot.window(xlim=c(0,0.6*max(fit$df$x)),ylim=c(15.7,17.5))
lines(newdata$x, newy)
axis(1)
axis(2)
abline(v=0, h=0)

mtext("FITC-insulin [mol]",1,2.4)
mtext("log intensity [log(LAU)]",2,2.4)
myydata=c(16.35,16.5,16.65,16.95,17.1,17.25)
source("predict_amount.r")
myxdata=predict_amount(fit,myydata,uselog=TRUE)
for(i in 1:length(myydata)){

lines(c(myxdata[i],myxdata[i],max(newdata)),c(min(newy),myydata[i],myydata[i]),lty=3)
    }
y1=seq(16.95,17.25,0.003)
y2=seq(16.35,16.65,0.003)
x1=predict_amount(fit,y1,TRUE)
x2=predict_amount(fit,y2,TRUE)
norm1=normpdf(y1,17.1,0.045)
norm1=min(newy)+norm1/max(norm1)*.5
norm2=normpdf(y2,16.5,0.045)
norm2=min(newy)+norm2/max(norm2)*.5
lines(x1,norm1,col="#0000FF")
lines(x2,norm2,col="#FF0000")
normy1=normpdf(y1,17.1,0.045)
normy1=normy1/max(normy1)*-.3e-10+max(newdata)
normy2=normpdf(y2,16.5,0.045)
normy2=normy2/max(normy2)*-.3e-10+max(newdata)
lines(normy1,y1,col="#0000FF")
lines(normy2,y2,col="#FF0000")
dev.off()

Thanks,

Markus Nenniger

	[[alternative HTML version deleted]]


