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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:57:46+00:00 2026-05-26T16:57:46+00:00

I am embarrassed to ask this simple question, but has been in kicking my

  • 0

I am embarrassed to ask this simple question, but has been in kicking my mind for several days whenever I create a plot:

plot (x = 1:10, y = rnorm (10, 5, 2))
grid (10,10, lty = 6, col = "cornsilk2")

I want to position the grids right at where axis are labelled, i.e. at 2, 4, 6, 8, 10 in x axis and similarly 3, 4, 5, 6, 7, 8 in y axis.

enter image description here

I want to automate the process as whenever the plot size changes the default label behaviour changes. See the following plot:

enter image description here

  • 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-26T16:57:47+00:00Added an answer on May 26, 2026 at 4:57 pm

    From ?grid description of the nx and ny arguments:

    When NULL, as per default, the grid aligns with the tick marks on the
    corresponding default axis (i.e., tickmarks as computed by axTicks)

    plot (x = 1:10, y = rnorm (10, 5, 2)) 
    grid (NULL,NULL, lty = 6, col = "cornsilk2") 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably a simple question, and I'm slightly embarrassed to ask it, but
I'm embarrassed to ask this one, it's a real newbie question but it's been
I'm trying to figure this simple thing but I'm actually embarrassed to ask such
This is so simple I'm embarrassed to ask, but how do you convert a
I am almost embarrassed to ask this question, but as a long time C
I'm sure this is a very simple question, but embarrassed to say I can't
This is a dumb question and I feel embarrassed to ask it, but I'm
I'm embarrassed to even ask this question, but after an exhausting search in google
Slightly embarrassed to ask such a simple question but I've wasted an hour now
I'm embarrassed to ask this question, but after 45 minutes of not finding a

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.