Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset 'par' (pty='s') value in R

I was trying to plot two graphs simultaneously. I did it usingpar(mfrow=c(2,1) and reset the par to default with par(mfrow=c(1,1).

I was trying to make the size of dots in the scatter plot and ended in trouble. I mistakenly used par(mfrow=c(,1),pty='s') and my plot got re-sized instead of re-sizing the size of scatter dots.

Sorry since Im new to R; I want to reset the size to default value. ie, the value for pty='s' should go to default. How can I do that!! I tried with par(opar) and par(resetPar()) which I found from stackoverflow, but both returning could not find error.

Also, may I know how to increase the size of scatter dot(s)? Should I ask this as separate question?

Thank you for your help..

like image 670
ajufsd Avatar asked Sep 21 '25 02:09

ajufsd


1 Answers

Before modifying the graphical parameters with par it may be useful to store the previous parameters:

old_par = par()

Then you'll be able to come back to previous settings by typing par(old_par). For your current problem, default value for pty is "m".

In any case, if you don't want to close your current graphical device to get the old_par parameter, you can still open a new one x11() then the par function will concern the new window, and then close it dev.off()

like image 162
ClementWalter Avatar answered Sep 22 '25 17:09

ClementWalter