Wednesday, March 3, 2021

Calculate and visualize horizontal distance between 2 (time series) lines

Hello,
Is there a convenient way to calculate and visualize horizontal distance between 2 lines? See example below: I would like to indicate the number of years (e.g. for Y-value of 70 and 72) it took for males to reach the same life expectancy as females

Code:
webuse uslifeexp
line le_m le_f year if year>1944
See graph below for an example (I manually added the arrow and the text) I would like to automate
Array

Thank you,
Mike

No comments:

Post a Comment