- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to save a plot in pdf in R?
To save a plot in pdf, we can use the pdf function in base R. For example, if we want to save a plot with the name PDF then it can be done using the below command −
pdf("PDF.pdf")
After this we can create the plot and use dev.off().
Example
pdf("pdfExample.pdf") plot(1:10)
Output
Example
dev.off()
Output
To check where it is saved, find the working directory using getwd().
- Related Articles
- How to save a plot as SVG created with ggplot2 in R?
- Save the plots into a PDF in matplotlib
- How to save figures to pdf as raster images in Matplotlib?
- How to save a histogram plot in Python?
- How to save as PDF on Chrome using Selenium
- How to save a plot in Seaborn with Python (Matplotlib)?
- How to save the plot to a numpy array in RGB format?
- Saving a 3D-plot in a PDF 3D with Python
- How to plot a function in R?
- How to save a vector in R as CSV file?
- How to save a csv and read using fread in R?
- How to save column means into a data frame in R?
- How to save the str output as a string in R?
- How to draw a violin plot in R?
- How to create a staircase plot in R?

Advertisements