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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:13:56+00:00 2026-05-23T11:13:56+00:00

I would like to plot a histogram with mean (average) value on it (e.g.

  • 0

I would like to plot a histogram with mean (average) value on it (e.g. we could mark it with a blue and bold line).

I tried to do it using plot command, but even if I set the parameter add=TRUE
it didn’t work.

  • 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-23T11:13:56+00:00Added an answer on May 23, 2026 at 11:13 am

    You can use abline() to add lines to a plot:

    x <- rnorm(100)
    mx <- mean(x)
    hist(x)
    abline(v = mx, col = "blue", lwd = 2)
    

    Have also a look at ?par for graphic parameters (like col and lwd).


    In general, you can also plot lines using lines():

    x <- rnorm(100, mean = 10)
    mx <- mean(x)
    hist(x)
    lines(c(mx,mx), c(0,15), col = "red", lwd = 2)
    lines(c(10, 11.5), c(0, 10), col = "steelblue", lwd = 3, lty = 22)
    text(mx, 18 , round(mx, 2))
    text(mx, 12 , "big", cex = 5)
    

    where text() is used for adding text. The argument cex describes the “character expansion factor”.

    Also, have a look at Quick-R for an overview of basic plotting with R.

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

Sidebar

Related Questions

I would like to plot a vertical line (I'd prefer any orientation, but I'd
I am using nltk with Python and I would like to plot the ROC
i would like to plot the following three functions in MATLAB using ezplot() but
I would like to have in the same figure a line plot and a
I would like to plot results from a MDS analysis with 3 dimensions using
I am using FullCalendar in one my projects and would like to plot recurring
I would like to plot implicit equations (of the form f(x, y)=g(x, y) eg.
I would like to plot y1 and y2 in the same plot. x <-
Would like to get a list of advantages and disadvantages of using Stored Procedures.
I would like to plot the greasy test signal in Matlab, and then plot

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.