"Error in plot.new() : figure margins too large" while plotting multiple graphs on the same plot in R

r
plot

#1

Hi,

I was trying to plot multiple histograms on the same plot in R for the variables in my dataset. I used ->

par(mfrow=c(4,2))
hist(data$season)

but got an error saying

Error in plot.new() : figure margins too large

How can I get rid of this error?

Thanks.


#2

@pravin

The problem is that you have a small region which is not sufficiently large enough to contain the default margins.

Put this code

par(mar = rep(2, 4))

after

par(mfrow=c(4,2))

and then try.
Hope it helps!


#3

write this in r console:
par(‘mar’)
it will give you current dimensions like this:
5.1,4.1,2.1,3.1
now update this according to your convenience like:
par(mar=c(1,1,1,1)
then use plot.
Hope it helps.