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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:49:52+00:00 2026-05-23T00:49:52+00:00

I want to plot a beta distribution in a double logarithmic plot. x <-

  • 0

I want to plot a beta distribution in a double logarithmic plot.

x <- seq(0, 1, length=1001)
y <- dbeta(x, 0.1, 0.1)
plot(x, y, type="h", log="xy")

The xtics are set at

0.001
0.005
0.01 (without label)
0.05
0.1 (without label)
0.5
1 (without label)

How can I determine:

  1. that labels are given for the main decimal positions (1.0, 0.1, 0.01, 0.001, 0.0001,…)

  2. that tics should be drawn for 9 position between the decimal positions (for the region between 0.01 and 0.1 it would be 0.01, 0.02, 0.03,….)

  3. that the maximum y-range should be 0.5

Thanks for your help.

Sven

  • 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-23T00:49:53+00:00Added an answer on May 23, 2026 at 12:49 am

    For fine control of the axes, plot them separately, so first suppress the axes by using argument axes = FALSE in the plot() call:

    plot(x, y, type="h", log="xy", axes = FALSE)
    

    Then add the axes as you want them

    axis(side = 1, at = (locs <- 1/c(1,10,100,1000)), labels = locs)
    axis(side = 2)
    box()
    

    Question 2 can be answered in the same way, you just need to specify the locations for the tick marks, perhaps setting argument argument tcl in the axis() call to be a bit smaller than default (which is -0.5). The tricky bit is in generating the minor ticks you want. I could only come up with this:

    foo <- function(i, x, by) seq(x[i,1], x[i, 2], by = by[i])
    locs2 <- unlist(lapply(seq_along(locs[-1]), FUN = foo, 
                           x= embed(locs, 2), by = abs(diff(locs)) / 9))
    

    or

    locs2 <- c(outer(1:10, c(10, 100, 1000), "/"))
    

    which both give:

    R> locs2
     [1] 0.100 0.200 0.300 0.400 0.500 0.600 0.700 0.800 0.900 1.000 0.010 0.020
    [13] 0.030 0.040 0.050 0.060 0.070 0.080 0.090 0.100 0.001 0.002 0.003 0.004
    [25] 0.005 0.006 0.007 0.008 0.009 0.010
    

    We use them via another call to axis():

    axis(side = 1, at = locs2, labels = NA, tcl = -0.2)
    

    We suppress labels here using labels = NA. You just need to work out how to do the vectors for at…

    Putting the two steps together we have:

    plot(x, y, type="h", log="xy", axes = FALSE)
    axis(side = 1, at = (locs <- 1/c(1,10,100,1000)), labels = locs)
    axis(side = 1, at = locs2, labels = NA, tcl = -0.3)
    axis(side = 2)
    box()
    

    Which produces:

    plot produced by axis calls

    As for question 3, what do you mean the maximum range? You can set the limits on the y-axis using the ylim argument to plot(). You provide the limits (min and max) like so

    plot(x, y, type="h", log="xy", axes = FALSE, ylim = c(0.2, 1))
    axis(side = 1, at = (locs <- 1/c(1,10,100,1000)), labels = locs)
    axis(side = 2)
    box()
    

    But a range on it’s own is not sufficient to define the limits, you’d need to tell us one of the min or max values to show on the plot or the actual range of values you want.

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

Sidebar

Related Questions

I have a 3-tuple data set (X,Y,Z points) that I want to plot using
I want to simulate values that represent a geometric distribution. The plot I have
I want to plot several curves, each having a different length. So, I've placed
I have a set of points I want to plot on an embedded Google
I want to plot stacked histograms in R; i.e. stack individual histograms in the
I want to use core-plot for drawing line graph dynamically. data won't come at
I want to create a pairs plot in R that has labels on the
I want to remove the space between the axes of the plot and the
want to know why String behaves like value type while using ==. String s1
I want to plot some data. The first column contains the x-data. But matplotlib

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.