在启动时将参数重置为默认值 [英] Reset par to the default values at startup

查看:95
本文介绍了在启动时将参数重置为默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,当我创建自己的绘图函数时,我会进行构造:

Normally when I make my own plot functions, I make a construct :

op <- par("mypar"=myvalue)
on.exit(par(op))

是将par还原为先前值的标准方法.想象一下,您正在运行一些确实改变了某些参数的函数,并且需要在R中启动时将其重置为默认值.这样做的便捷方法是什么?

which is the standard way of reverting the par to the previous values. Imagine you've been running some functions that did change some of the pars, and you need to reset to the default values at startup in R. What is the convenient way of doing so?

或者换句话说:如何达到par()的默认值?

Or in other words : how does one reaches the default values for par()?

推荐答案

每次打开新设备,par()都会重置,因此另一个选择就是简单地dev.off()并继续.

Every time a new device is opened par() will reset, so another option is simply do dev.off() and continue.

这篇关于在启动时将参数重置为默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆