I'm pretty sure I've seen this here before, but I can't seem to find the post. I'm interested in adding the value of the last observation to a line chart. Consider the data below,
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input int year float unemployment
1990 5.9
1991 8
1992 9.9
1993 9.9
1994 9.3
1995 8
1996 8.1
1997 6.9
1998 6.6
1999 5.9
2000 5.4
2001 5.7
2002 6.7
2003 7
2004 6.5
2005 5.4
2006 4.8
2007 5.1
2008 7.6
2009 11.6
2010 12.5
2011 12.2
2012 10.9
2013 9.8
2014 8.3
2015 6.6
2016 5.3
2017 4.8
2018 4.7
end
I would like a line chart (
twoway line unemployment year) with the value of the last observation appended to the line (4.7). I've attached a screenshot that I found of someone doing this using Stata (if that helps to explain what I'm getting at - I know not everyone is fond of screenshots because they're often not easy to see).
Array
0 Response to Adding a label to the last observation on a line chart
Post a Comment