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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:49:35+00:00 2026-05-30T02:49:35+00:00

I’m making a plot in R I’d like to have a symbol appear at

  • 0

I’m making a plot in R I’d like to have a symbol appear at a specific point (say, alpha) on my y axis. My x axis uses a log-scale so I don’t think I can use the xy coordinates (0, alpha) to plot the point (I may be wrong).

I’ve tried something like this:

W.range <- range(W)
Z.range <- range(Z1, Z2)
# Draw Empty Graph 
plot(W.range, Z.range, type="n", log="x")
# First Curve
lines(W, Z1, type="l", lty=1, lwd=1.5, col=1)
# Second Curve
lines(W, Z2, type="l", lty=2, lwd=1.5, col=2)
# Plot Single Point on vertical axis at level alpha (for some constant alpha)
points(x=0, y=alpha, pch=1, col=1)

However, I get errors relating to the x=0 coordinate. Advice? As always, I appreciate the suggestions.

  • 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-30T02:49:37+00:00Added an answer on May 30, 2026 at 2:49 am

    This should work, subbing in your own data as appropriate:

    # Example data and plot
    x <- y <- 1:100
    alpha <- 44
    plot(x,y, log="x", type="l")    
    
    # Add point
    points(x = 10^(par("usr")[1]), 
           y = alpha, 
           pch = 16, cex=1.3, col = "red", las = 1,
           xpd = TRUE) # controls whether or not pts straddling the axis are clipped
    

    enter image description here

    To understand what I did here, have a look at ?par, which I use here both to query and to set graphical parameters.

    In particular, here is the description of par("usr"), from the help file linked above:

    ‘usr’ A vector of the form ‘c(x1, x2, y1, y2)’ giving the extremes
          of the user coordinates of the plotting region.  When a
          logarithmic scale is in use (i.e., ‘par("xlog")’ is true, see
          below), then the x-limits will be ‘10 ^ par("usr")[1:2]’.
          Similarly for the y-axis.
    

    The x-coordinates returned by usr are in terms of the log-transformed values of x. Thus, to get a point placed on the y-axis, you need to give it an x coordinate such that it’s log (base 10) is equal to the location of the y-axis, expressed in user coordinates. par("usr")[1] gets you the location of the lower limit of the x-axis: 10^(par("usr")[1] gets you the x-value that will be plotted to just that part of the x-axis.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.