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

  • Home
  • SEARCH
  • 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 6720229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:11:15+00:00 2026-05-26T09:11:15+00:00

When plotting an XTS object without any custom par attributes, I get a margin

  • 0

When plotting an XTS object without any custom par attributes, I get a margin within the plot box (or “plot area” going off of http://research.stowers-institute.org/efg/R/Graphics/Basics/mar-oma/index.htm):

enter image description here

(It is hard to see due to white on white, but there is another maybe 20px or so between plot box (the box with the solid black line) and the edge of the image).

How can I adjust the margin within the plot box?

  • 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-05-26T09:11:16+00:00Added an answer on May 26, 2026 at 9:11 am

    You could fix this by setting yaxs="i" in your call to plot() or plot.xts()

    yaxs and xaxs specify the methods used to calculate the extent of the plotted axes. yaxs="r" (the default) is to extend the axis a bit beyond your minimum and maximum y-values. yaxs="i" plots axes that just cover the range of your data (or the supplied value of ylim) with no additional buffer.

    It’s not pretty, but this example will show you the difference:

    require(xts)
    par(mfcol=c(1,2))
    data(sample_matrix)
    plot(as.xts(sample_matrix))
    plot(as.xts(sample_matrix), yaxs="i")
    

    If you want even finer control over the range plotted, you might want to use yaxs="i" in combination with ylim=extendrange(range(yvalues)).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When plotting a graph with a discontinuity/asymptote/singularity/whatever, is there any automatic way to prevent
I am plotting a dataset using the following: plot = ggplot(transData, aes(x=Time, y=Value)) +
Are there any good libraries available for plotting candlestick and other types of financial
Possible Duplicate: Plotting 4 curves in a single plot, with 3 y-axes assuming I
Possible Duplicate: Plotting 4 curves in a single plot, with 3 y-axes I have
I am plotting two lines using plot(x, y, type = l, color = red)
Does anyone have any experience of plotting DAFIF data in ESRI products? are there
I have created a MATLAB plotting with the plot() function. How do I change
When plotting a function using Plot, I would like to obtain the set of
I've never used any graph plotting package in R, I'm familiar with basic plotting

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.