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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:01:23+00:00 2026-05-25T21:01:23+00:00

I would like to place the x-axis labels between the ticks. For example, by

  • 0

I would like to place the x-axis labels between the ticks.

For example, by default R produces a graph that looks like this:
(Note, I added axis(1,c(2001,2002,2003,2004,2005,2006,2007,2008,2009,2010)) to give the larger amount of label years, otherwise R only uses 2002 2004 2006 2008 2010 as labels.)
enter image description here

But I want to move the labels such that the plot looks like this:
enter image description here

I tried looking, but I don’t even know what it’s called doing this.

  • 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-25T21:01:23+00:00Added an answer on May 25, 2026 at 9:01 pm

    You can offset the labels and the ticks with separate calls to axis.

    (The example below does not look much like your data, but the idea is the same.)

    Plot whatever, but keep the axes off.

    plot(1:10, axes = FALSE)
    

    Plot the labels at a half spacing offset and turn off the ticks. (Reverse the numbers just to be “interesting”).

    axis(1, at = (1:10) + 0.5, labels = 10:1, tick = FALSE)
    

    Add the ticks back at the normal position, and keep the labels off. Add a box to finish the job.

    Be careful though, the labels are now kind of ambiguous in terms of which tick they refer to, and what the tick position actually is (though for a year start to end that should not be a problem).

    axis(1, at = (1:10), labels = FALSE, tick = TRUE)
    box()
    

    offset labels from ticks

    You can use axis(2, ...) to construct the y-axis in the same way, or just use defaults with axis(2).

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

Sidebar

Related Questions

I Have a canvas and would like to place silverlight elements within that canvas
in matplotlib, how do i place ticks labels between ticks (not below ticks) for
I would like to place an if condition within the sub that will tell
I would like to place a comment ( <!-- this --> style) at the
I would like to place a canvas on top of an image that I
I would like to place an image into the background of my activities. This
I have a UIView that I would like to animate a flip up. This
I've got a div that I would like to rotate about its y-axis (with
In my android application,i would like to place a progress bar such that it
I have a section of PHP code that I would like to place in

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.