Dear R experts How do I save a plot to a file in a specified format, f.ex ’png’? Apparently ’save.plot’ no longer exists, so I tried instead dev.print(file="H:\\jesperf\\data1image",device=png()) However no file is created and – much worse – no graphics is produced (on screen or file) if I run f.ex qqnorm afterwards. What am I doing wrong and how do I get R to print graphics on the screen as ususal? Thanks in advance for your help. Kim. ------------ Kim Mouridsen M.Sc., Ph.D student Center for Functionally Integrative Neuroscience (CFIN) Århus University Hospital Nørrebrogade 44 Building 30, 1. DK-8000 Århus C, Denmark Phone +45 8949 4099 FAX +45 8949 4400 [[alternative HTML version deleted]]
I can't help you with 1.7.1: it is obselete. But since you are apparently using Windows, there are menus in 1.8.0 to do what you want, as well as the command savePlot() (AFAIK there never was a function save.plot). On Mon, 20 Oct 2003, Kim Mouridsen wrote:> Dear R experts > > > > How do I save a plot to a file in a specified format, f.ex ?png?? > > > > Apparently ?save.plot? no longer exists, so I tried instead > > > > dev.print(file="H:\\jesperf\\data1image",device=png())That should be device=png, not png(), as the help page says.> However no file is created and ? much worse ? no graphics is produced > (on screen or file) if I run > > f.ex qqnorm afterwards.Try dev.list() and dev.off()?> What am I doing wrong and how do I get R to print graphics on the screen > as ususal?-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote: (AFAIK there never was a function save.plot). In R 1.7.1 ?save.plot does in fact list save.plot among the ?Defunct functions. In the text, it says The new function `dev.print()' should now be used for saving plots to a file or printing them. ?dev.print explains device: A device function (e.g., `x11', `postscript', ...) which unfortunately suggests that the argument should be a string, but the example dev.print(device=postscript, ...) makes all clear. R on-line documentation is really _very_ good.
Apparently Analagous Threads
- regression with limited range response
- samba 3 create_connection_server_info failed: NT_STATUS_ACCESS_DENIED
- Within-subject factors in lme
- [CORRECTED] Postfix SMTP authentication on remote relay serve
- Samba 4.7.1 Switching from SAMBA_INTERNAL to BIND_DLZ failed