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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:58:00+00:00 2026-05-26T00:58:00+00:00

Is it possible to draw an uneven axis in R? I know that I

  • 0

Is it possible to draw an uneven axis in R? I know that I can specify labels at specific spots, but I mean, I want a particular section of my graph to be spread out. For instance, imagine an X axis such as:

-10 -5 0 1 2 3 4 5 10

where there is equal spacing between each of the above values.

  • 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-26T00:58:01+00:00Added an answer on May 26, 2026 at 12:58 am

    You would need to make a factor of your levels, say “fac”, and then plot. Later using axis() with labels=as.character(fac).

     dat <- data.frame(x=factor(c(-10 ,-5, 0, 1, 2, 3, 4, 5, 10)), y=1:9)
    
     with(dat, plot(x, y))   # a step-like plot
     with(dat, plot(as.numeric(x), y, type="p", xaxt="n")) # points instead of steps
     axis(1, at=1:9, labels=as.character(dat$x))           # the "irregular" axis
    

    Thinking further about @Ben Bolker’s question, it should also be possible to define a an auxiliary x-value to determine the plotting “x=” and the axis “at=” coordinate on the horizontal and then using unique(as.character(.)) applied to the “real x” as the “labels=” argument to axis as shown above but not needing a factor construction. An even more complex scheme is possible with this approach where continuous values across specific ranges of the auxiliary variable could be used for plotting but truncated values constructed for the labels at the boundaries of those ranges. I think further design justification and specification would be needed before building an implemented example.

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

Sidebar

Related Questions

I want to draw text into UIView 's subview using drawInRect:withFont:lineBreakMode call but that
Does any one know how it possible to move/draw dashed line at specific position
Is possible to draw a Shape that has a background made by slanted lines?
Is possible to draw a quad given its normal vector, a point that is
Is it possible to draw an arrow that has semi-transparent border around it just
is it possible to draw a line semi-transparent with image magick? i want to
I know that it is possible to add annotations to an iOS Map. Is
Is possible to draw lines in octave with plot or plot3? I mean, to
Is it possible to draw a self referencial association at one specific class in
Is it possible to draw circle using css only which can work on most

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.