Announcement

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

  • Not to scale axis. Custom axis.

    Hi,

    I was wondering if there is a way to have special scale axis in a graph to make a sort of zoom. So for example, in a graph with a yrange from 1 to 10, make it so as the graph's height between 1 and 2 is the same as between 2 and 10.

    Thanks

  • #2
    A negative reciprocal scale comes close and is not extraordinarily esoteric.

    Code:
    clear
    set obs 10
    gen y = 42
    gen x = _n
    gen recx = -1/x
    mylabels 1/5 7 10, myscale(-1/@) local(labels)
    scatter y recx , xla(`labels') ms(Dh) xtitle(x) note(negative reciprocal scale)
    Click image for larger version

Name:	negrec.png
Views:	1
Size:	14.3 KB
ID:	1465558



    See mylabels (SSC)

    https://www.stata-journal.com/sjpdf....iclenum=gr0052

    https://www.stata-journal.com/sjpdf....iclenum=gr0032

    https://www.stata.com/support/faqs/g.../scale-breaks/

    Logarithmic scales are easier to explain, however!
    Last edited by Nick Cox; 11 Oct 2018, 17:30.

    Comment


    • #3
      Thank you so much Dr. Cox, this is an incredibly useful solution. I also love logarithm scales, but some medical journal editors do not share our common love!

      Comment


      • #4
        Originally posted by Nick Cox View Post

        Code:
        clear
        set obs 10
        gen y = 42
        Solving for the answer to life the universe and everything?

        Comment


        • #5
          Ah, Chris, you mustn't explain in-jokes.

          Comment


          • #6
            Duly noted

            Comment

            Working...
            X