检查是否在R中已存在一个图表?

huangapple go评论74阅读模式
英文:

Check whether there exists a plot already in R?

问题

这是情况:
我想要绘制一个图表(例如,一条线),但如果已经存在一个绘图,那么我将追加绘图,即lines(...),否则我将绘制新的图表,即plot(....)
因此,在绘制之前如何检查是否已经存在绘图?提前感谢!

英文:

Here is the situation:
I want to draw a graph(e.g, a line),but if there exists a plot already,then I will append the plot,i.e. lines(...), otherwise I will draw new graph,i.e. plot(....).
Thus how to check whether there exists a plot already before drawing? Thanks in advance!

答案1

得分: 0

你可以使用下面的函数来查看活动设备/图表的列表。如果它返回NULL,那么你所有的设备/图表都已关闭。

dev.list()

英文:

You can use the below function to view the list of active devices/plots. If it returns NULL then all of your devices/plots are off.

dev.list()

huangapple
  • 本文由 发表于 2020年1月3日 13:14:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/59573512.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定