Announcement

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

  • Fine-tuning the legend position

    I am looking for a proper parameter responsible for vertical positioning of the legend in the twoway graphics.

    Consider the following example:

    Code:
    clear all
    sysuse auto
    graph twoway line length weight price, legend(pos(5))
    Click image for larger version

Name:	Legend_move.png
Views:	1
Size:	160.0 KB
ID:	1533745



    I've found the position can be fine-tuned with the Y-offset in the graph editor:
    Click image for larger version

Name:	Y-offset.png
Views:	1
Size:	33.7 KB
ID:	1533746


    But I don't see a corresponding parameter in the command syntax.

    I've also experimented with the bmargin() option, it does allow me to programmatically increase the gap between the plotregion and the legend, but at the expense of wasting more space under the graph (including under the legend) which is undesirable.

    If anything I am looking for a solution that would be neutral to the units/magnitudes of the y-axis of the main plot.

    Thank you, Sergiy Radyakin




Working...
X