Jesse001
Jesse001

Reputation: 924

How to resize a plot (not the window) in R?

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!!

Upvotes: 1

Views: 14366

Answers (1)

Jesse001
Jesse001

Reputation: 924

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!

Upvotes: 4

Related Questions