Quantcast

Can't save a plot

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Can't save a plot

Tomek.Tarczynski
Hi,
I can't save a plot in R. Even the most simple examples taken from the internet doesn't work:

jpeg('rplot.jpg')
plot(1:10)
dev.off()

The message that I receive is:
"> jpeg('rplot.jpg')
> plot(1:10)
> dev.off()
null device
          1 "

I've also tried using png, pdf, and so on...

I've windows 7 64b.
Ive tried R 2.15.0 x86 and x64, same result in both.

Can anyone tell me what is wrong?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Can't save a plot

Michael Weylandt
Are you sure it's not working? That's exactly what the console is
supposed to display (the message means you've switched from the jpeg
_to_ the null device) -- check again to make sure the file wasn't
created -- I think you'll be pleasantly surprised.

If you're not sure where to check, look in the directory returned by
getwd(); you can do this from within R by using list.files()

Best,
Michael

On Sat, Jun 23, 2012 at 5:47 AM, Tomek.Tarczynski
<[hidden email]> wrote:

> Hi,
> I can't save a plot in R. Even the most simple examples taken from the
> internet doesn't work:
>
> jpeg('rplot.jpg')
> plot(1:10)
> dev.off()
>
> The message that I receive is:
> "> jpeg('rplot.jpg')
>> plot(1:10)
>> dev.off()
> null device
>          1 "
>
> I've also tried using png, pdf, and so on...
>
> I've windows 7 64b.
> Ive tried R 2.15.0 x86 and x64, same result in both.
>
> Can anyone tell me what is wrong?
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Can-t-save-a-plot-tp4634281.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Can't save a plot

Tomek.Tarczynski
I'm a bit ashamed, because it actually works, but I'd some problems with the privilages because it is not working when I set wd to c:\, when I changed I used default wd everything is working.
Thanks for pointing out my ingorance!

Best,
Tomek
Loading...