\documentclass{standalone} \usepackage{luamplib} \usepackage{unicode-math} \setmainfont[Numbers=OldStyle]{TeX Gyre Pagella} \setmathfont{TeX Gyre Pagella Math} \def\tl#1{\vbox{\tiny\let\\\cr\halign{\hss ##\hss\cr#1\crcr}}} \begin{document} \mplibtextextlabel{enable} \begin{mplibcode} input basedate path euro, years, events; euro = (base(1999, 01, 31), 70.256200) -- (base(1999, 02, 28), 68.85200) -- (base(1999, 03, 31), 67.106100) -- (base(1999, 04, 30), 66.456200) -- (base(1999, 05, 31), 65.751900) -- (base(1999, 06, 30), 65.054700) -- (base(1999, 07, 31), 65.818600) -- (base(1999, 08, 31), 66.039600) -- (base(1999, 09, 30), 64.618500) -- (base(1999, 10, 31), 64.604600) -- (base(1999, 11, 30), 63.715400) -- (base(1999, 12, 31), 62.694500) -- (base(2000, 01, 31), 61.723600) -- (base(2000, 02, 29), 61.416200) -- (base(2000, 03, 31), 61.095600) -- (base(2000, 04, 30), 59.795100) -- (base(2000, 05, 31), 60.165300) -- (base(2000, 06, 30), 62.91600) -- (base(2000, 07, 31), 62.337900) -- (base(2000, 08, 31), 60.789500) -- (base(2000, 09, 30), 60.777700) -- (base(2000, 10, 31), 58.965700) -- (base(2000, 11, 30), 60.020900) -- (base(2000, 12, 31), 61.469800) -- (base(2001, 01, 31), 63.488500) -- (base(2001, 02, 28), 63.3800) -- (base(2001, 03, 31), 62.956100) -- (base(2001, 04, 30), 62.167200) -- (base(2001, 05, 31), 61.405900) -- (base(2001, 06, 30), 60.874200) -- (base(2001, 07, 31), 60.811600) -- (base(2001, 08, 31), 62.70600) -- (base(2001, 09, 30), 62.322400) -- (base(2001, 10, 31), 62.422700) -- (base(2001, 11, 30), 61.851800) -- (base(2001, 12, 31), 61.94300) -- (base(2002, 01, 31), 61.676200) -- (base(2002, 02, 28), 61.136700) -- (base(2002, 03, 31), 61.565600) -- (base(2002, 04, 30), 61.413900) -- (base(2002, 05, 31), 62.738200) -- (base(2002, 06, 30), 64.39600) -- (base(2002, 07, 31), 63.882400) -- (base(2002, 08, 31), 63.575100) -- (base(2002, 09, 30), 63.061600) -- (base(2002, 10, 31), 63.008300) -- (base(2002, 11, 30), 63.737600) -- (base(2002, 12, 31), 64.218200) -- (base(2003, 01, 31), 65.650100) -- (base(2003, 02, 28), 66.890200) -- (base(2003, 03, 31), 68.137100) -- (base(2003, 04, 30), 68.917100) -- (base(2003, 05, 31), 71.205200) -- (base(2003, 06, 30), 70.409100) -- (base(2003, 07, 31), 69.997700) -- (base(2003, 08, 31), 69.876900) -- (base(2003, 09, 30), 69.764400) -- (base(2003, 10, 31), 69.859800) -- (base(2003, 11, 30), 69.252500) -- (base(2003, 12, 31), 70.127900) -- (base(2004, 01, 31), 69.311900) -- (base(2004, 02, 29), 67.658400) -- (base(2004, 03, 31), 67.186300) -- (base(2004, 04, 30), 66.456100) -- (base(2004, 05, 31), 67.167300) -- (base(2004, 06, 30), 66.304900) -- (base(2004, 07, 31), 66.615300) -- (base(2004, 08, 31), 66.917400) -- (base(2004, 09, 30), 68.148700) -- (base(2004, 10, 31), 69.067300) -- (base(2004, 11, 30), 69.916800) -- (base(2004, 12, 31), 69.655900) -- (base(2005, 01, 31), 70.672300) -- (base(2005, 02, 28), 68.954800) -- (base(2005, 03, 31), 69.266800) -- (base(2005, 04, 30), 68.301400) -- (base(2005, 05, 31), 68.404700) -- (base(2005, 06, 30), 66.887400) -- (base(2005, 07, 31), 68.613100) -- (base(2005, 08, 31), 68.5500) -- (base(2005, 09, 30), 67.759400) -- (base(2005, 10, 31), 68.186800) -- (base(2005, 11, 30), 67.934800) -- (base(2005, 12, 31), 67.914300) -- (base(2006, 01, 31), 68.629700) -- (base(2006, 02, 28), 68.299400) -- (base(2006, 03, 31), 68.879200) -- (base(2006, 04, 30), 69.411300) -- (base(2006, 05, 31), 68.343200) -- (base(2006, 06, 30), 68.7700) -- (base(2006, 07, 31), 68.851400) -- (base(2006, 08, 31), 67.681500) -- (base(2006, 09, 30), 67.498800) -- (base(2006, 10, 31), 67.294500) -- (base(2006, 11, 30), 67.386300) -- (base(2006, 12, 31), 67.297100) -- (base(2007, 01, 31), 66.365300) -- (base(2007, 02, 28), 66.73900) -- (base(2007, 03, 31), 67.988900) -- (base(2007, 04, 30), 67.95900) -- (base(2007, 05, 31), 68.144800) -- (base(2007, 06, 30), 67.589800) -- (base(2007, 07, 31), 67.449200) -- (base(2007, 08, 31), 67.714700) -- (base(2007, 09, 30), 68.791700) -- (base(2007, 10, 31), 69.624700) -- (base(2007, 11, 30), 70.779800) -- (base(2007, 12, 31), 72.135100) -- (base(2008, 01, 31), 74.638700) -- (base(2008, 02, 29), 74.922400) -- (base(2008, 03, 31), 77.322800) -- (base(2008, 04, 30), 79.552400) -- (base(2008, 05, 31), 79.079900) -- (base(2008, 06, 30), 79.094700) -- (base(2008, 07, 31), 79.236500) -- (base(2008, 08, 31), 79.221500) -- (base(2008, 09, 30), 79.928300) -- (base(2008, 10, 31), 78.440300) -- (base(2008, 11, 30), 82.852800) -- (base(2008, 12, 31), 90.767900) -- (base(2009, 01, 31), 92.114300) -- (base(2009, 02, 28), 88.967100) -- (base(2009, 03, 31), 91.925500) -- (base(2009, 04, 30), 89.774800) -- (base(2009, 05, 31), 88.591200) -- (base(2009, 06, 30), 85.739200) -- (base(2009, 07, 31), 86.02100) -- (base(2009, 08, 31), 86.196800) -- (base(2009, 09, 30), 89.16800) -- (base(2009, 10, 31), 91.597400) -- (base(2009, 11, 30), 89.818800) -- (base(2009, 12, 31), 89.911700) -- (base(2010, 01, 31), 88.424400) -- (base(2010, 02, 28), 87.548100) -- (base(2010, 03, 31), 90.177300) -- (base(2010, 04, 30), 87.677600) -- (base(2010, 05, 31), 85.83100) -- (base(2010, 06, 30), 82.888900) -- (base(2010, 07, 31), 83.636200) -- (base(2010, 08, 31), 82.39800) -- (base(2010, 09, 30), 83.807500) -- (base(2010, 10, 31), 87.57300) -- (base(2010, 11, 30), 85.595400) -- (base(2010, 12, 31), 84.741200) -- (base(2011, 01, 31), 84.729300) -- (base(2011, 02, 28), 84.686200) -- (base(2011, 03, 31), 86.708800) -- (base(2011, 04, 30), 88.313100) -- (base(2011, 05, 31), 87.653300) -- (base(2011, 06, 30), 88.668300) -- (base(2011, 07, 31), 88.569400) -- (base(2011, 08, 31), 87.548400) -- (base(2011, 09, 30), 87.21700) -- (base(2011, 10, 31), 87.015700) -- (base(2011, 11, 30), 85.784300) -- (base(2011, 12, 31), 84.494100) -- (base(2012, 01, 31), 83.159600) -- (base(2012, 02, 29), 83.664600) -- (base(2012, 03, 31), 83.485600) -- (base(2012, 04, 30), 82.378400) -- (base(2012, 05, 31), 80.472400) -- (base(2012, 06, 30), 80.644300) -- (base(2012, 07, 31), 78.858800) -- (base(2012, 08, 31), 78.862900) -- (base(2012, 09, 30), 79.89500) -- (base(2012, 10, 31), 80.69300) -- (base(2012, 11, 30), 80.362500) -- (base(2012, 12, 31), 81.282400) -- (base(2013, 01, 31), 83.14100) -- (base(2013, 02, 28), 86.2300) -- (base(2013, 03, 31), 85.989300) -- (base(2013, 04, 30), 85.050300) -- (base(2013, 05, 31), 84.83100) -- (base(2013, 06, 30), 85.192200) -- (base(2013, 07, 31), 86.163400) -- (base(2013, 08, 31), 85.98600) -- (base(2013, 09, 30), 84.243200) -- (base(2013, 10, 31), 84.770300) -- (base(2013, 11, 30), 83.829200) -- (base(2013, 12, 31), 83.68200) -- (base(2014, 01, 31), 82.752100) -- (base(2014, 02, 28), 82.464100) -- (base(2014, 03, 31), 83.143900) -- (base(2014, 04, 30), 82.506500) -- (base(2014, 05, 31), 81.574400) -- (base(2014, 06, 30), 80.463800) -- (base(2014, 07, 31), 79.300800) -- (base(2014, 08, 31), 79.758700) -- (base(2014, 09, 30), 79.150400) -- (base(2014, 10, 31), 78.837400) -- (base(2014, 11, 30), 79.037400) -- (base(2014, 12, 31), 78.805100) -- (base(2015, 01, 31), 76.705900) -- (base(2015, 02, 28), 74.11400) -- (base(2015, 03, 31), 72.317800) -- (base(2015, 04, 30), 72.364700) -- (base(2015, 05, 31), 72.255300) -- (base(2015, 06, 30), 72.076600) -- (base(2015, 07, 31), 70.762500) -- (base(2015, 08, 31), 71.401100) -- (base(2015, 09, 30), 73.266100) -- (base(2015, 10, 31), 73.267700) -- (base(2015, 11, 30), 70.662300) -- (base(2015, 12, 31), 72.61500) -- (base(2016, 01, 31), 75.332500) -- (base(2016, 02, 29), 77.556300) -- (base(2016, 03, 31), 78.041900) -- (base(2016, 04, 30), 79.311700) -- (base(2016, 05, 31), 77.868700) -- (base(2016, 06, 30), 79.00800) -- (base(2016, 07, 31), 84.173500) -- (base(2016, 08, 31), 85.603400) -- (base(2016, 09, 30), 85.237500) -- (base(2016, 10, 31), 89.187500) -- (base(2016, 11, 30), 86.6400) -- (base(2016, 12, 31), 84.447800) -- (base(2017, 01, 31), 86.087300) -- (base(2017, 02, 28), 85.299700) -- (base(2017, 03, 31), 86.653800) -- (base(2017, 04, 30), 84.7200) -- (base(2017, 05, 31), 85.610300) -- (base(2017, 06, 30), 87.732600) -- (base(2017, 07, 31), 88.646200) -- (base(2017, 08, 31), 91.20400) -- (base(2017, 09, 30), 89.478400) -- (base(2017, 10, 31), 89.03800) -- (base(2017, 11, 30), 88.873100) -- (base(2017, 12, 31), 88.37100) -- (base(2018, 01, 31), 88.307800) -- (base(2018, 02, 28), 88.380700) -- (base(2018, 03, 31), 88.297700) -- (base(2018, 04, 30), 87.298900) -- (base(2018, 05, 31), 87.835600) -- (base(2018, 06, 30), 87.852700) -- (base(2018, 07, 31), 88.778300) -- (base(2018, 08, 31), 89.686900) -- (base(2018, 09, 30), 89.369500) -- (base(2018, 10, 31), 88.273600) -- (base(2018, 11, 30), 88.099300) -- (base(2018, 12, 31), 89.733600) -- (base(2019, 01, 31), 88.56500) -- (base(2019, 02, 28), 87.257800) -- (base(2019, 03, 31), 85.830800) -- (base(2019, 04, 30), 86.259500) -- (base(2019, 05, 31), 87.048600) -- (base(2019, 06, 30), 89.14400) -- (base(2019, 07, 31), 89.935100) -- (base(2019, 08, 31), 91.649700) -- (base(2019, 09, 30), 89.223500) -- (base(2019, 10, 31), 87.21200) -- (base(2019, 11, 30), 85.81800) -- (base(2019, 12, 31), 84.903300) -- (base(2020, 01, 31), 84.880700) -- (base(2020, 02, 29), 84.179300) -- (base(2020, 03, 31), 89.452900) -- (base(2020, 04, 30), 87.50400) -- (base(2020, 05, 31), 88.826200) -- (base(2020, 06, 30), 89.960700) -- (base(2020, 07, 31), 90.43400) -- (base(2020, 08, 31), 90.034100) -- (base(2020, 09, 30), 91.040100) -- (base(2020, 10, 31), 90.656300) -- (base(2020, 11, 30), 89.649300) -- (base(2020, 12, 31), 90.677900) -- (base(2021, 01, 31), 89.174800) -- (base(2021, 02, 28), 87.189400) -- (base(2021, 03, 31), 85.864500) -- (base(2021, 04, 30), 86.550500) -- (base(2021, 05, 31), 86.335700) -- (base(2021, 06, 30), 85.900900) -- (base(2021, 07, 31), 85.619400) -- (base(2021, 08, 31), 85.315600) -- (base(2021, 09, 30), 85.644300) -- (base(2021, 10, 31), 84.744100) -- (base(2021, 11, 30), 84.789100) -- (base(2021, 12, 31), 84.94200) -- (base(2022, 01, 31), 83.52100) -- (base(2022, 02, 28), 83.827900) -- (base(2022, 03, 31), 83.615400) -- (base(2022, 04, 30), 83.557800) -- (base(2022, 05, 22), 84.892600) ; years = (base(1999, 01, 01), 1999) for y=2000 upto 2022: -- (base(y, 1, 1), y) endfor; numeric offset; offset = base(1999, 1, 1); euro := euro shifted -(offset, 0) xscaled 42 yscaled 3; years := years shifted -(offset, 0) xscaled 42; beginfig(1); draw euro withcolor 3/4 blue; numeric baseline; baseline = 54*3; draw (xpart point 0 of euro, baseline) -- (xpart point infinity of euro, baseline); for t = 1 upto length years: numeric x, y, q; (x, y) = point t of years; 4q = xpart (point t-1 of years - point t of years); draw (x, baseline) -- (x, baseline + 4); for i=1 upto 3: draw (x + i*q, baseline) -- (x + i*q, baseline + 2); endfor if not odd y: label.bot("\small\strut " & decimal y, (x, baseline)); fi endfor numeric minx, miny, maxx, maxy; miny = 1000; maxy = 0; minx = maxx = 0; for i=0 upto length euro: numeric x, y; (x, y) = point i of euro; if y > maxy: maxy := y; maxx := x; fi if y < miny: miny := y; minx := x; fi endfor draw (2 up -- up) scaled 2 shifted (maxx, maxy) withcolor red; draw (2 down -- down) scaled 2 shifted (minx, miny) withcolor red; numeric left_axis, right_axis; left_axis = -16; right_axis = 368; draw (left_axis, miny) -- (left_axis, maxy); for y = 60 step 10 until 100: draw (left_axis, 3y) -- (left_axis + 2, 3y); label.lft("\small\strut " & if y < 100: "0." & decimal y else: "1.00" fi, (left_axis, 3y)); endfor draw (right_axis, miny) -- (right_axis, maxy); for eur = 100 step 10 until 170: numeric y; y = 100/eur * 100; draw (right_axis, 3y) -- (right_axis - 2, 3y); label.rt("\small\strut " & if eur=100: "1.00" else: "1." & decimal (eur mod 100) fi, (right_axis, 3y)); endfor label.top("\small £/€", (left_axis - 10, 310)); label.top("\small €/£", (right_axis + 10, 310)); interim dotlabeldiam := 3/2; dotlabel.top("\tiny Creation", (base(1999, 1, 1) - offset, 71) xscaled 42 yscaled 3); dotlabel.top("\tiny 9/11", (base(2001, 9, 11) - offset, 64) xscaled 42 yscaled 3); dotlabel.lrt("\tl{Lehmans\\collapse}", (base(2008, 9, 15) - offset, 77) xscaled 42 yscaled 3); dotlabel.lrt("\tl{Brexit\\vote}", (base(2016, 6, 24) - offset, 77) xscaled 42 yscaled 3); dotlabel.bot("\tl{UK leaves\\EU}", (base(2020, 1, 31) - offset, 83) xscaled 42 yscaled 3); dotlabel.top("\tl{WHO declares\\pandemic}", (base(2020, 3, 11) - offset, 91) xscaled 42 yscaled 3); dotlabel.bot("\tl{Ukraine\\invaded}", (base(2022, 2, 24) - offset, 82.5) xscaled 42 yscaled 3); picture p; p = currentpicture; currentpicture := nullpicture; bboxmargin := 12; fill bbox p withcolor 1/32(32, 32, 31); draw p; endfig; \end{mplibcode} \end{document}