Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • user control of log axis display

    Stata 13.1, updated this week.

    I'm using the built in Stata -graph- commands, specifically -twoway scatter- and the axis_scale_options -, yscale(log), to plot variables with ranges of 3 to 4 orders of magnitude. The result is just as shown on Page 419 of the Graphics manual, with two thirds of the total axis length given over to displaying the first order of magnitude data, squeezing the other 2-3 order of magnitude data into the remaining third.

    I there any way to display logarithmic axes in the style we used to see in the old printed log-linear graph paper, with equal space given to each order of magnitude?

    I've done due diligence searching manuals, Stata Forum, old archives, Stata Journal but find no hints.

    All suggestions welcome.

    Steve Rothenberg
    National Institute of Public Health
    Cuernavaca, Morelos, Mexico

  • #2
    In the graph page 419 you could add the option:
    Code:
    xlabel(1 10 100 1000 10000 100000)

    Comment


    • #3
      Thanks, Svend. Easy in retrospect and worked like a charm.
      Steve

      Comment


      • #4
        If you want to go really "old school" (or at least the log-linear graph paper I remember using in school) you can also type:

        twoway function y= 2^x - 1 , range(0.1 20) yscale(log)
        ylab(0.1 "10{sup:-1}" 1 "10{sup:0}" 10 "10{sup:1}" 100 "10{sup:2}" 1000 "10{sup:3}" ///
        10000 "10{sup:4}" 100000 "10{sup:5}" 1000000 "10{sup:6}", angle(horizontal))

        To get an axis scale in this format:
        Click image for larger version

Name:	Graph.png
Views:	1
Size:	42.8 KB
ID:	85435
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment

        Working...
        X