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 8997399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:53:03+00:00 2026-06-15T23:53:03+00:00

I am exporting some plots to EPS files. My code is setEPS() postscript(test.eps) par(mar=c(0,0,0,0))

  • 0

I am exporting some plots to EPS files. My code is

setEPS()
postscript("test.eps")
par(mar=c(0,0,0,0))
plot(1:10)
dev.off()

But I find that there are (device) margins around the plotting area. How to remove them? Thank you.

  • 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-15T23:53:04+00:00Added an answer on June 15, 2026 at 11:53 pm

    That isn’t a margin. Notice how there are no axes, tick marks or plot frame in the EPS produced by your code. There is no room to draw these and the plot frame will be exactly on the edge of the EPS.

    What you are seeing is the extra padding that R adds to the axis limits to ensure that the plotting characters are inside the plot region, not on it’s edge. IIRC this padding is 4%.

    You can turn this off using using the xaxs and yaxs plotting parameters for the x- and y-axis respectively; see ?par

     ‘xaxs’ The style of axis interval calculation to be used for the
          x-axis.  Possible values are ‘"r"’, ‘"i"’, ‘"e"’, ‘"s"’,
          ‘"d"’.  The styles are generally controlled by the range of
          data or ‘xlim’, if given.
          Style ‘"r"’ (regular) first extends the data range by 4
          percent at each end and then finds an axis with pretty labels
          that fits within the extended range.
          Style ‘"i"’ (internal) just finds an axis with pretty labels
          that fits within the original data range.
          ** editted for brevity **
          (_Only ‘"r"’ and ‘"i"’ styles have been implemented in R._)
    

    The default is "r", instead use:

    setEPS()
    postscript("test.eps")
    par(mar=c(0,0,0,0), xaxs = "i", yaxs = "i")
    plot(1:10)
    dev.off()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i use this code for exporting gridview to Excel in asp.net - c# .....but
I am exporting gridview data to excel but that excel file add the some
When exporting rather complicated plots (especially ListDensityPlot ) as a PDF or EPS (for
I've started exporting some of my frequently used blocks of code to custom snippets.
I am trying to protect some C++ code by exporting as a DLL (on
I'm exporting a database created by somebody else, that contains some views, but the
Exporting some data from mysql to a csv file using FasterCSV. I'd like the
I'm exporting some data, making a file and writing the data to the file...
So I have some Spanish content saved in Excel, that I am exporting into
We're exporting our analytics reports in various formats, among them CSV. For some clients

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.