Announcement

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

  • Option -orientation()- in legend()

    Dear all,

    why the option orientation(vertical), listed among the options that can be used in legend(), does not make anything vertical?
    I would expect it to rotate either the whole legend or only the labels by 90 degrees, but it does not do anything instead.

    Example:
    Code:
    clear
    sysuse auto
    tw sca pri wei if fore || ///
       sca pri wei if !fore   ///
       , legend(orientation(vertical))
    Thank you.

    Best,
    ir
    // ivica_rubil //

  • #2
    The orientation option affect pieces of words, not one word. When you use one word as legend label, then it is vertical per se. You can run the code below to find the difference.
    Code:
    tw sca pri wei if fore || sca pri wei if !fore , legend(label(1 "f""o""r""e""i""g""n") label(2 "nonforeign") orientation(vertical))

    Comment


    • #3
      I do not agree with #2, the option -orientation()- is doing nothing in your code. Compare

      Code:
      tw sca pri wei if fore || sca pri wei if !fore , legend(label(1 "f""o""r""e""i""g""n") label(2 "nonforeign") orientation(vertical))
      and

      Code:
      tw sca pri wei if fore || sca pri wei if !fore , legend(label(1 "f""o""r""e""i""g""n") label(2 "nonforeign") orientation(horizontal))

      #1 makes a good point. I can only speculate that your scheme does not allow a non-horizontal orientation. I would direct the question to StataCorp (Technical Services). Either they withdraw the option or they explain in what cases it is applicable.

      Comment


      • #4
        Yes, Andrew, you are right.

        Comment


        • #5
          Thanks, Chen and Andrew. Although the question remains open, at least I know now it is not due to my messing up something.
          // ivica_rubil //

          Comment

          Working...
          X