1

Hopefully a simple question for the community tonight: I'm creating a boxplot with particularly long xlabels, which are rotated. The issue I'm running in to is that regardless of what plot window size I set using

dev.new(width=999, height=999)

The plot itself stretches to fill the window,and the x labels are chopped. How do I resize the plot itself, regardless of window size? My current plotting code is:

boxplot(mean_density~Landscape*category,ylab="Mean density",las=2,data=data1C)

The reason the X labels are so long is because of that landscape*category piece.

Thanks in advance!!

Jesse001
  • 924
  • 1
  • 13
  • 37
  • 2
    Its a good idea when asking questions to include a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with some sample data that we can use for testing possible solutions. But most likely with base graphics you'll just need to increase the margin size in `par()`. – MrFlick Sep 06 '16 at 23:09

1 Answers1

4

Thanks to MrFlicks quick response I managed to track down the mar() function within par().

boxplot(mean_density~Land.Cat,ylab="Mean density",las=2,data=data1C)

generated:

enter image description here

whereas
boxplot(mean_density~Land.Cat,ylab="Mean_density",las=2,par(mar=c(9,4,1,4)),data=data1C)

generates:

enter image description here

Figured it'd be an easy one:-D thanks for the help!

Community
  • 1
  • 1
Jesse001
  • 924
  • 1
  • 13
  • 37