Sherri Heck
2013-Mar-10 15:19 UTC
[R] Editing figure without re-running the plotting code?
Dear all, I am curious if anyone knows of a command/program that would enable one to edit a figure in R once it is created (akin to Matlab). Currently, if I need to make any changes to the figure I do so and then have to run the plotting portion of the code again. I have searched the R site mailing lists, etc to no avail. Any help is greatly appreciated. Kind regards, Sherri [[alternative HTML version deleted]]
Jeff Newmiller
2013-Mar-10 16:18 UTC
[R] Editing figure without re-running the plotting code?
The normal method is to rerun the code. If you use the ggplot2 library you can store plots in variables and modify them, but you still have to print them again when you want to see the results. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Sherri Heck <sherri.heck at gmail.com> wrote:>Dear all, > >I am curious if anyone knows of a command/program that would enable one >to >edit a figure in R once it is created (akin to Matlab). Currently, if >I >need to make any changes to the figure I do so and then have to run the >plotting portion of the code again. I have searched the R site mailing >lists, etc to no avail. Any help is greatly appreciated. > >Kind regards, > >Sherri > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.
On 03/11/2013 02:19 AM, Sherri Heck wrote:> Dear all, > > I am curious if anyone knows of a command/program that would enable one to > edit a figure in R once it is created (akin to Matlab). Currently, if I > need to make any changes to the figure I do so and then have to run the > plotting portion of the code again. I have searched the R site mailing > lists, etc to no avail. Any help is greatly appreciated. >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