Announcement

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

  • Twoway graphs: yaxis only on the right-hand side (like in The Economist)

    Dear Forum,

    I wonder how to create graphs that have the yaxis only on the right-hand side, like many graphs in The Economist, for example (e.g. here).

    When I use the axis-specifier, it doesn't work:
    Code:
    clear
    input data time 
    1 1900
    2 1901
    3 1902
    2 1903
    3 1904
    end
    
    line data time, yaxis(2) ylabel(, axis(2))
    Thanks for any help!
    Fabian


  • #2
    Code:
    line data time, yaxis(1 2) ysc(off axis(1))

    Comment


    • #3
      Also note that there is a scheme "economist" that will do this by default.

      Code:
      clear
      input data time
      1 1900
      2 1901
      3 1902
      2 1903
      3 1904
      end
      
      line data time,  scheme(economist)
      Click image for larger version

Name:	Graph.png
Views:	1
Size:	28.3 KB
ID:	1636612

      Comment


      • #4
        Thank you, Nick!

        @Andrew: I should have said that I am aware of that scheme but I don't want to use the scheme.
        Last edited by Fabian Hula; 15 Nov 2021, 10:17.

        Comment

        Working...
        X