
Hi guys,
 
I really appreciated all your responds, I made mistake on my example below hwere I wrote device.off() where it should be dev.off().
 
I read all the help documnet for odf png and postscript before I posted my question but it didn't help.
 
Can some one please code an example?
 
Thanks
 



Date: Sun, 4 Nov 2012 02:39:13 -0800
From: ml-node+s789695n4648380h31@n4.nabble.com
To: frespider@hotmail.com
Subject: Re: Saving R Graph to a file

On 11/4/2012 4:32 AM, Robert Baer wrote: 

> Some hints: 
> For pdf(), height and width are in inches, not pixels.  dev.off() is 
> necessary after drawing the image for pdf(). The name for the file 
> argument (file="c:/figure.xxx") is file not filename 
> 
> hist(CO2[,5]) is more interesting 
> 
> And yes, 
> ?pdf 
> ?postscript ?png 

> 
> On 11/3/2012 11:16 PM, frespider wrote: 
>> Hi 
>> 
>> I am not sure why I can't get my plot saved to a file as .ps, I searched 
>> online and I found that I have to use something is called 
>> postscript,png or 
>> pdf function which I did but still not working. 
>> 
>> Actually what I have is a matrix with almost 300-400 columns. I need to 
>> create a histogram and boxplot for some columns as .ps file (with 
>> reasonable 
>> size if i can adjust that would be nice also) so I can import them in my 
>> latex code to display a good chart on my report.  And I found out R 
>> display 
>> a certain limit of device. 
>> Can you please help me code this? 
>> 
>> This an example I create 
>> data(CO2) 
>> png(filename="C:/R/figure.png", height=295, width=300, bg="white") 
>> hist(CO2[,4]) 
>> device.off() 
>> pdf(filename="C:/R/figure.pdf", height=295, width=300, bg="white") 
>> hist(CO2[,4]) 
>> postscript(filename="C:/R/figure.pdf", height=295, width=300, 
>> bg="white") 
>> hist(CO2[,4]) 
>> 
>> 
>> Thanks 
>> 
>> 
>> 
>> 
>> 
>> -- 
>> View this message in context: 
>> http://r.789695.n4.nabble.com/Saving-R-Graph-to-a-file-tp4648369.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. 
> 
> 

-- 
__________________ 
Robert W Baer, Ph.D. 
Professor of Physiology 
Kirksville College of Osteopathic Medicine 
A. T. Still University of Health Sciences 
Kirksville, MO 63501 US 

______________________________________________ 
[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. 






If you reply to this email, your message will be added to the discussion below:http://r.789695.n4.nabble.com/Saving-R-Graph-to-a-file-tp4648369p4648380.html 
To unsubscribe from Saving R Graph to a file, click here.
NAML  		 	   		  



--
View this message in context: http://r.789695.n4.nabble.com/Saving-R-Graph-to-a-file-tp4648369p4648393.html
Sent from the R help mailing list archive at Nabble.com.
	[[alternative HTML version deleted]]


