Skip to content
Prev 319187 / 398506 Next

Editing figure without re-running the plotting code?

On 03/11/2013 02:19 AM, Sherri Heck wrote:
Hi Sherri,
As Jeff has pointed out, graphics devices in R are almost entirely 
cumulative in operation. You can display something, then add something 
else, but you don't have a buffer for the various objects in a complex 
plot that allows those objects to be altered or deleted.

The playwith package would probably allow you to do what you want, but 
there is a certain amount of learning necessary and you have to navigate 
the complexity that is hidden in most interactive plotting packages. 
That said, if you have to do a lot of this, it is worth the effort.

What most of us do is to build plots up as scripts in an external editor 
and then "source" the scripts. You can make incremental changes and the 
new plot just pops up when you source the code.

Jim