Problems with edges in R plotting

I'm having a hard time dealing with cutting edges in R plots. The problem: Edge problem http://i57.tinypic.com/rsas14.jpg Code:

x <- c(130, 145, 170, 175, 180)
y <- c(0.00172225, 0.00207025, 0.002304, 0.0025, 0.002704)*1000
plot(x,y,pch=20)
fit <- lm(y~x) 
xx <- seq(120,190, length=50)
plot(x,y,xlab=(expression('U'~~'[V]')),main=expression(atop(Something)),  ylab=expression(r[1]^2~~"[mm]"),pch=19,xlim=c(120, 190),  ylim=c(0.001,0.003)*1000)
xHigh <- x+5
yHigh <- y+c(0.083, 0.091, 0.096, 0.100, 0.104)
xLow <- x-5
yLow <- y-c(0.083, 0.091, 0.096, 0.100, 0.104)
eps <- 1
eps2 <- 0.05
segments(x-eps,yLow,x+eps,yLow,col=2)
segments(x-eps,yHigh,x+eps,yHigh,col=2)
segments(xLow,y-eps2,xLow,y+eps2,col=2)
segments(xHigh,y-eps2,xHigh,y+eps2,col=2)
segments(x,yLow,x,yHigh,col=2)
segments(xLow,y,xHigh,y,col=2)
lines(xx, predict(fit, data.frame(x=xx)), col="blue")
summary(fit)

How can I resolve this problem? Thanks in advance!

Answers


Before your plot(), increase the size of your left margin:

par(mar=c(5,5,4,2)+.1)
plot(x,y,pch=20)

Base graphics simply provide a fixed number of lines on each side of the plot regardless of what you attempt to draw there.


Need Your Help

Developing a secure WS client for consuming a Axis2 Web Service with Rampart WS Security module?

web-services jax-ws axis2 ws-security rampart

I have a Axis2 web service secured using Rampart. I do want to develop secure clients for it, preferably JAX-WS based. I tried a lot of tutorials but they are so closed tied with each other, like

python spambot featureset list size

python nlp

novice coder here, trying to sort out issues I've found with a simple spam detection python script from Youtube.