Announcement

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

  • Labelling lines directly on the graph

    Hello I have the following data:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input int year float(tw_eshare sk_eshare jp_eshare hk_eshare us_eshare ch_eshare)
    1999   .353104  .2180597   .132673  .07837033 .013242254 .0037732776
    2000  .3613982  .1935984 .14054033  .09470285  .01197752 .0041396185
    2001  .3733647 .18836835 .13537122  .09850802 .011657768  .008487331
    2002  .3761892  .2064878 .12076926  .11045322 .011942135  .011063125
    2003  .3783749  .2163858 .11433821  .09861916 .011756462  .016428739
    2004  .3859389  .2263669 .11611678  .08417509 .012050012  .016369808
    2005  .3845172 .22625177  .1219711  .07566063 .012466455   .02556598
    2006 .37641215 .23493522  .1331212 .070133805 .013106585   .02747921
    2007  .3615798 .24617197 .14213298  .06388681 .015180472  .032136057
    2008  .3476018  .2535338 .14422223  .06750516 .014348704   .03782948
    2009  .3287824 .24717003  .1626905  .06264513  .01920605   .04352529
    2010  .3215968 .25062367 .16644105  .06488687  .01863375    .0437016
    2011  .3131113 .25433823   .173319  .06182805 .016680311   .04585869
    2012  .3052285 .25912577 .17756553   .0608872 .016151281   .04603336
    2013  .3044777 .26401043  .1663623  .06046329 .017376207   .04823454
    2014  .2974295 .28048614  .1559516 .065785125  .01672531   .05081726
    2015 .28691626 .29673535 .14978747  .06400553 .016013706   .05590628
    2016 .27359244  .3085391   .143486 .065558076 .015584015   .06190511
    2017 .26286304  .3131993 .14147463  .06799361 .015544648   .07033642
    end
    and the following code:

    Code:
    twoway (connected tw_eshare year, mcolor(navy) msize(vsmall) msymbol(circle) lcolor(navy) lpattern(solid)) (connected sk_eshare year, mcolor(midgreen) msize(vsmall) msymbol(square) lcolor(midgreen) lpattern(dash)) (connected jp_eshare year, mcolor(purple) msize(vsmall) msymbol(triangle) lcolor(purple) lpattern(longdash)) (connected hk_eshare year, mcolor(maroon) msize(vsmall) msymbol(diamond) lcolor(maroon) lpattern(dash_dot)) (connected us_eshare year, mcolor(orange_red) msize(small) msymbol(lgx) lcolor(orange_red) lpattern(shortdash_dot)) (connected ch_eshare year, mcolor(red) msize(small) msymbol(plus) lcolor(red) lpattern(longdash_shortdash)), legend(off)
    My chart does not look the best right now, but I'm trying to get there. I would like to know how I can add a label directly next to the lines for each of these series, for example, each series represents a country, so next to the end of each line on the graph I would like to label it with the country for which it corresponds. The countries are Taiwan, South Korea, Japan, Hong Kong, US, China.

    Thanks,
    Jad


  • #2


    Hi Jad,

    I faced the same issue, and it's now resolved. Take a look at my posts in #22 and #23. https://www.statalist.org/forums/for...-figures/page2

    Comment

    Working...
    X