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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:39:08+00:00 2026-05-27T09:39:08+00:00

I like to produce my own grid lines when plotting so I can control

  • 0

I like to produce my own grid lines when plotting so I can control tick marks, etc. and I am struggling with this with the ‘hist’ plotting routine.

    hist(WindSpeed, breaks=c(0:31), freq=TRUE, col="blue", xaxt="n", yaxt="n", xlab="Wind Speed (m/s)",main="Foo", cex.main=1.5, cex.axis=1, cex.lab=1, tck=1, font.lab=2)
    axis(1, tck=1, ,col.ticks="light gray")
    axis(1, tck=-0.015, col.ticks="black")
    axis(2, tck=1, col.ticks="light gray", lwd.ticks="1")
    axis(2, tck=-0.015)
    minor.tick(nx=5, ny=2, tick.ratio=0.5)
    box()

Plot:
enter image description here

I have then just been able to use the ‘lines’ or ‘points’ command to replot the data over top for other types of plots, but with the histogram its not so easy.

Any help would be great.

I added my code below and image based upon John’s response…

I added my code below and image based upon John’s response…

hist(WindSpeed, breaks=30, freq=TRUE, col="blue", xaxt="n", yaxt="n", xlab="Wind Speed (m/s)",main="Foo", cex.main=1.5, cex.axis=1, cex.lab=1, font.lab=2)
axis(1, tck=1, col.ticks="light gray")
axis(1, tck=-0.015, col.ticks="black")
axis(2, tck=1, col.ticks="light gray", lwd.ticks="1")
axis(2, tck=-0.015)
minor.tick(nx=5, ny=2, tick.ratio=0.5)
box()
hist(WindSpeed, add=TRUE, breaks=30, freq=TRUE, col="blue", xaxt="n", yaxt="n", xlab="Wind Speed (m/s)", main="Foo", cex.main=1.5, cex.axis=1, cex.lab=1, font.lab=2)

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-27T09:39:09+00:00Added an answer on May 27, 2026 at 9:39 am

    This is relatively easy.

    Generate the histogram but don’t plot it.

    h <- hist(y, plot = FALSE)
    

    Now generate your base plot… I’ve added some features to make it look more like a standard historgram

    plot(h$mids, h$counts, ylim = c(0, max(h$counts)), xlim = range(h$mids)*1.1, 
        type = 'n', bty = 'n', xlab = 'y', ylab = 'Counts', main = 'Histogram of y')
    

    add your grid

    grid()
    

    add your histogram

    hist(y, add = TRUE)
    

    Or, as I discovered through this process… you can do it even easier

    hist(y)
    grid()
    hist(y, add = TRUE, col = 'white')
    

    This last method is just redrawing the histogram over the grid.

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

Sidebar

Related Questions

Anybody know how to produce an xml element like this in rails using xml
Can you program/configure Visual Studio to produce custom intellisense for your own server controls.
I would like to produce a file that I can load into memory (for
I would like to produce an executable that could make an update verification before
I'd like to produce sounds that would resemble audio from real instruments. The problem
I would like to produce a character list of all of the first letters
I would like to produce C# helper files from the KML2.2 xml schema using
I would like to produce a binary zip distribution of my project that would
I'm using Visual Studio 2008 (C++) and would like to produce a list of
What I'd like to do is produce an HTML/CSS/JS version of the following. The

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.