1

I have a panel plot shown below. The main problem is ylab and xlab titles are not showing up. How can I set it or reduce the graphics to have all within the window? panel plot

Below the command used to make the plot:

par(mar=rep(2,4))
par(mfrow=c(4,2))

 plot(me.ts,las=1,
  main=" ",     # Main title for t`enter code here`he plot  
 xlab="Time",                 # Label for the x-axis  
 ylab="rainfall (mm/day)",   # Label for the y-axis  
 font.lab=1,                  # Font to use for the axis labels: 1=plain 
 ylim=c(0, 4), # Range for the y-axis; "x
 xaxp=c(2071,2095,4), # X-axis min, max and
 bty="l", lwd=2)  
 me.time = time(me.ts)
 abline(reg=lm(me.ts ~ me.time),col="blue", lwd=2, asp=1)
  m=lm(me.ts ~ me.time)
  • Please consider making your example reproducible. But I think your problem lies in your setting of the margins. Margins go around the plot-region, and if they need to be wide enough to allow for your axis texts. – Heroka Oct 29 '15 at 15:57
  • The dataset is 8 time series I read using ncdf and then plot as panel using the above setting and the plot command for each ts. I repeated the plot command 8 times as above to have the panel plotted. The main problem as you mentioned is margins problem. Now what is the best way to set this correctly? – user3290596 Oct 29 '15 at 17:02
  • Why did you change them in the first place? What's wrong with the defaults? – Heroka Oct 29 '15 at 17:29
  • In the first time I used the default and was having an error message: – user3290596 Oct 29 '15 at 18:13
  • What was the error? And please consider making your example [reproducible](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)....... – Heroka Oct 29 '15 at 18:14
  • Error in plot.new() : figure margins too large I then set the par(mar=rep(2,4)) and it worked but the subtitles of ylab and xlab. The program don't issue an error message which look strange to me. – user3290596 Oct 29 '15 at 18:15
  • You could toy with the margins, or try to make the entire plotting area larger. You could try par(mar=c(5,4,1,1)). – Heroka Oct 29 '15 at 18:18
  • It looks I am not qualified for chat! I tried your setting and the sub-titles are showing up but too far from the y and x axis. If a way ti get it closer will be fine. – user3290596 Oct 29 '15 at 19:02

0 Answers0