Green Files

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

Day: 06/02/2022 - Time: 16:34:13

I've looked in different questions for a solution and I've tried what was suggested but I have not found a solution to make it work.

Everytime I want to run this code it always says:

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

and I don't know how to fix it. Here is my code:

par(mfcol=c(5,3)) hist(RtBio, main="Histograma de Bio Pappel") boxplot(RtBio, main="Diagrama de Caja de Bio Pappel") stem(RtBio) plot(RtBio, main="Gráfica de Dispersión") hist(RtAlsea, main="Histograma de Alsea") boxplot(Alsea, main="Diagrama de caja de Alsea") stem(RtAlsea) plot(RtTelev, main="Gráfica de distribución de Alsea") hist(RtTelev, main="Histograma de Televisa") boxplot(telev, main="Diagrama de Caja de Televisa") stem(Telev) plot(Telev, main="Gráfica de dispersión de Televisa") hist(RtWalmex, main="Histograma de Walmex") boxplot(RtWalmex, main="Diagrama de caja de Walmex") stem(RtWalmex) plot(RtWalmex, main="Gráfica de dispersión de Walmex") hist(RtIca, main="Histograma de Ica") boxplot(RtIca, main="Gráfica de caja de Ica") stem(RtIca) plot(RtIca, main="Gráfica de dispersión de Ica")

Solution

Every time you are creating plots you might get this error - "Error in plot.new() : figure margins too large". To avoid such errors you can first check par("mar") output. You should be getting:

[1] 5.1 4.1 4.1 2.1

To change that write:

par(mar=c(1,1,1,1))

This should rectify the error. Or else you can change the values accordingly.

Reference:

https://stackoverflow.com/questions/23050928/error-in-plot-new-figure-margins-too-large-scatter-plot

GO UP
GO TO INDEX