Announcement

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

  • Labeling lines in graph in plot area (not using legend)

    Hi - I am doing a simple two-way line graph where I would like to label each of the lines in the plot area. I do not want to use the legend. One alternative would be to label a specific data point in the line, but is there an alternative that does not involve identifying/labeling a specific data point?
    Thank you,
    Christina

  • #2
    Welcome to the Stata Forum / Statalist.

    You may wish to use - text() - options, such as:

    Code:
    . sysuse auto
    (1978 Automobile Data)
    
    . twoway (connect mpg weight if foreign ==0, sort) (connect mpg weight if foreign ==1, sort), text(25 3700 "Foreign car") text(12 3500 "Domestic car") legend(off)
    Click image for larger version

Name:	Graph_test_text.png
Views:	1
Size:	48.7 KB
ID:	1413246
    Last edited by Marcos Almeida; 04 Oct 2017, 04:38.
    Best regards,

    Marcos

    Comment


    • #3
      Thank you. This should work.

      Comment


      • #4
        Another example at https://www.statalist.org/forums/for...aphs-with-line

        Comment

        Working...
        X