Skip to content

Plot-region not complete

2 messages · Markus Häge, David Winsemius

#
Hello there,

after I solved many problems in the last days with R I wanted to
complete my plot. I used
ylab=expression(paste("log(",mu,"/",cm^2,"/VS)"))
to have greek symbols and to change cm^2 to cm?. Also cm^-3 I have in
another plot, but it cuts my ^2 to _ in the y-axis.

here is the code and I attach the plot:

jpeg(file="Tabh2.jpg",quality=100)
plot(Temp3,bew2log,xlab="log(T/K)",ylab=expression(paste("log(",mu,"/cm^2/VS)")),xlim=range(c(Temp3)),cex.axis=1.5,cex.lab=1.5)
abline(reg=fitbew,lty=1)
lines(Temp3,bewt2,lty=2)
legend(1.932,2.9,c("Experiment"),pch=1,bty="n")
legend(1.9,2.88,c("Regression","Theorie"),bty="n",lty=c(1,2))
dev.off()

Somewhere I have to add a bigger plot-region... and I don't know the
code.

thanks

Markus
#
On Nov 28, 2009, at 12:09 PM, Markus H?ge wrote:

            
It would seem obvious that we cannot reproduce what you are seeing  
without "Temp3" or bew2log" or "fitbew", but it also seems as though  
some of your questions are concerning how to mix text and Greek  
letters in the ylab argument, for which the data is not really needed.

?plotmath
?bquote   # I'm too clueless get either expression or as.expression to  
"work".
# bquote also offers the possibility of substitution of values  
through .()

jpeg(file="Tabh2.jpg",quality=100);
plot(1,1, xlab="log(T/K)", ylab=bquote(log(mu/cm^2/VS)), xlim=c(-4,4),  
cex.axis=1, cex.lab=1)
legend(1.932,2.9,c("Experiment"),pch=1,bty="n")
legend(1.9,2.88,c("Regression","Theorie"),bty="n",lty=c(1,2));
dev.off()
You need bigger margins so the superscripted exponents do not get cut  
off on the left side, not bigger plot regions, that is if you want  
cex.lab > 1. To do that you need to reset the margins for the device  
_after_ the device is opened.

jpeg(file="Tabh2.jpg",quality=100);   par(mar=c(5, 5, 4, 2) + 0.1)
plot(1,1,xlab="log(T/K)",ylab=bquote(log(mu/cm^2/VS)), xlim=c(-4,4),  
cex.axis=1.5, cex.lab=1.5)
legend(1.932,2.9,c("Experiment"),pch=1,bty="n")
legend(1.9,2.88,c("Regression","Theorie"),bty="n",lty=c(1,2));
dev.off()

I am on a Mac, so it is possible that you will not get the  
satisfactory result I am viewing at the moment.