Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9194281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:22:28+00:00 2026-06-17T21:22:28+00:00

I am not able to open the plot when saved as pdf or other

  • 0

I am not able to open the plot when saved as pdf or other format. Consistently getting the following error. I am working on mac.

> plot(1:10)
> pdf('deleteIt.pdf')
> dev.off()
RStudioGD 
        2 


> sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] pROC_1.5.4 plyr_1.7.1

loaded via a namespace (and not attached):
[1] tools_2.15.1

I am getting the following error. Itried with png and jpeg too, but no luck..

The file “deleteIt.pdf” could not be opened.
It may be damaged or use a file format that Preview doesn’t recognize.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:22:29+00:00Added an answer on June 17, 2026 at 9:22 pm

    You did it backwards. Try this

    pdf("deleteIt.pdf")
    plot(1:10)
    dev.off()
    

    Start the device. Write to it. Turn it off.


    Alternatively, as pointed out by @Spacedman in a comment, you can create a pdf with whatever is currently plotted by using dev.copy like this:

    plot(1:10)
    dev.copy(pdf, "deleteIt.pdf")
    dev.off()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not able to open an excel file to write data using following
os.system(open /Applications/Mail.app) I'm able to open mac applications using the above statement(though not able
I'm not able to open my JAR file using the following code. Though, I'm
I am not able to open a url for read() using urllib or urllib2
I'm not able to open an infoWindow when I select a polygon. Here's my
I'm very surprised not to be able to open my Xcode project on another
This is an open ended interview question. I am not able to get a
I am not able to open the meta data url http://localhost:8082/Tasks/mex , even though
I am not able to open one particular url using urllib2. Same approach works
Suddenly, I'm not able to open the console or anything else related to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.