The PDF format for saving images is the most used for creating scientific documents, as they are easy to add to LaTeX and maintain the resolution even if you zoom in. However, if you need to edit the image after saving in order to add some decoration or perform some modifications you should use SVG. First, in order to save a plot as PDF in R you will need to open the graphics device with the pdf function, create the plot you desire and finally, close the opened device with the dev.
You can also change the width and height in inches of the output plot, the paper and point size, or modify the background color, as the PDF plot will have a transparent background, or the color model, among other graphical parameters. This function also allows you to modify the height, width and point size with the height , width and pointsize arguments, respectively, but also the anti-alias with the antialias argument.
Note that you could open the SVG file with Adobe Illustrator, Inkscape or other similar software to edit the vector graphic as you want. For example, to save a plot in pdf format we will use the pdf function. Once the code has run we need to close the pdf plotting device using the dev. If we want to save this plot in png format we simply use the png function in more or less the same way we used the pdf function.
Prepare your data as described here: Best practices for preparing your data and save it in an external. Import your data into R as described here: Fast reading of data from txt csv files into R: readr package. If you are working with RStudio, the plot can be exported from menu in plot panel lower right-pannel. The R code above, saves the file in the current working directory.
This analysis has been performed using R statistical software ver. Yeah, not what I need; but handy links for other situations. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science.
Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked Related Hot Network Questions. Question feed.
Stack Overflow works best with JavaScript enabled.
0コメント