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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:53:41+00:00 2026-06-09T01:53:41+00:00

I am creating a plot in R and I dont like the x axis

  • 0

I am creating a plot in R and I dont like the x axis values being plotted by R.

For example:

x <- seq(10,200,10)
y <- runif(x)

plot(x,y)

This plots a graph with the following values on the X axis:

50, 100, 150, 200

However, I want to plot the 20 values 10,20, 30 ... 200 stored in variable x, as the X axis values. I have scoured through countless blogs and the terse manual – after hours of searching, the closest I’ve come to finding anything useful is the following (summarized) instructions:

  1. call plot() or par(), specifying argument xaxt='n'
  2. call axis() e.g. axis(side = 1, at = seq(0, 10, by = 0.1), labels = FALSE, tcl = -0.2)

I tried it and the resulting plot had no x axis values at all. Is it possible that someone out there knows how to do this? I can’t believe that no one has ever tried to do this before.

  • 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-09T01:53:43+00:00Added an answer on June 9, 2026 at 1:53 am

    You’ll find the answer to your question in the help page for ?axis.

    Here is one of the help page examples, modified with your data:

    Option 1: use xaxp to define the axis labels

    plot(x,y, xaxt="n")
    axis(1, xaxp=c(10, 200, 19), las=2)
    

    Option 2: Use at and seq() to define the labels:

    plot(x,y, xaxt="n")
    axis(1, at = seq(10, 200, by = 10), las=2)
    

    Both these options yield the same graphic:

    enter image description here


    PS. Since you have a large number of labels, you’ll have to use additional arguments to get the text to fit in the plot. I use las to rotate the labels.

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

Sidebar

Related Questions

I am creating a plot with names on x axis and time values(minutes) on
i'm looking for some help in creating a faceted plot with angeled x-axis tick
See this example This was created in matlab by making two scatter plots independently,
I would like to create a graph like this one using gnuplot (or matplotlib,
I'm creating a project using Polymaps JS lybrary. I have to plot about 200,000
I'm creating a map with basemap and would like to put a graph in
I'm creating a plot in R, and need to add an en dash to
(creating a separate question after comments on this: Javascript redeclared global variable overrides old
I would like to put an int into a string . This is what
I'm creating a plot and adding a basic loess smooth line to it. qplot(Age.GTS2004.,

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.