FIELDimageR icon indicating copy to clipboard operation
FIELDimageR copied to clipboard

Use `withr::local_par` to set graphical parameters

Open weiyaw opened this issue 3 years ago • 2 comments

Hi,

Would you consider using withr::local_par to set the graphical parameters?

The current code sets the graphical windows to par(mfrow = c(1, 1)) at the end of functions. However, this line of code won't be executed if the functions exit prematurely. It also forcibly set the user's graphical windows to c(1, 1) which might not be desirable.

withr::local_par will only set the parameters in the local scope and revert the parameters back to its original state whenever functions stop running.

weiyaw avatar Jul 30 '21 03:07 weiyaw

Weiyaw,

That's a great suggestion.

Our team will work on this.

Thank you, Filipe

filipematias23 avatar Jul 30 '21 14:07 filipematias23

Now that #26 has been merged can this be closed?

dlebauer avatar Dec 05 '21 16:12 dlebauer