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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:22:59+00:00 2026-05-27T13:22:59+00:00

I have the following density plot: My input data looks as follows: PA <-

  • 0

I have the following density plot:

enter image description here

My input data looks as follows:

PA <- c(3028.0,3083.0,2958.0,2889.0,2758.0,2815.0,2877.0,3145.0,3072.0,3056.0,2856.0,2934.0,3112.0,2913.0,2837.0)

I used the following commands to make my plot:

plot(density(PA), main="Avidin PA")
abline(v=2913, col="red")

I’ve added a reference line in red, how do I make the reference line stop when it intercepts the plot?

  • 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-27T13:23:00+00:00Added an answer on May 27, 2026 at 1:23 pm

    We’ll need to do a little bit of work to figure out what the density approximately is at the given x value. Once we have that we can use the lines command to plot the line of interest. This should give a start:

    PA <- c(3028.0,3083.0,2958.0,2889.0,2758.0,2815.0,2877.0,3145.0,3072.0,3056.0,2856.0,2934.0,3112.0,2913.0,2837.0)
    
    den.PA <- density(PA)
    lineat = 2913
    
    # Find which x value that the density was computed
    # for is the closest to the x value we want a line at
    lineheight <- den.PA$y[which.min(abs(den.PA$x - lineat))]
    plot(den.PA, main="Avidin PA",)
    lines(c(lineat, lineat), c(0, lineheight), col = "red")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a ggplot2 density plot (geom_density) I have the following y-axis labels 0.000 0.005
I have generated the following plot using the R code that follows it: ggplot(lengths,
I have the following data frame z x y 1 1 a 2 2
How to get density of a screen? I have tried with the following code.
I have an XML program in the following structure <Part> <ID>1</ID> <Density>3</Density> <Parameter> <Element>Alloy</Element>
Have following validation for year value from text input: if (!year.match(new RegExp('\\d{4}'))){ ... }
I have following data: Dictionary<string,string> dctParameters = new Dictionary(){ {a,var1},{b,var2},{c,var3},.... } I want to
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I have following string String str = replace :) :) with some other string;
I have following foreach-loop: using System.IO; //... if (Directory.Exists(path)) { foreach(string strFile in Directory.GetFiles(path,

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.