I would like to draw an vertical that appears on top of a plot from a "graph twoway" command. I have seen solutions on this forum that use the "scatteri" command to manually draw the vertical line.
My problem is that I do not know beforehand what parameters to use for the "scatteri" command. That is, I don't know the rage of y-values to use for the vertical line. After the graph is produced, I can eyeball the graph and plug in numbers, but I would like to automate the process. Is there a way to figure out what y-values to use beforehand?
I figure that if I can run the command once, without "scatteri" and then recover the y-coordinates of the plot region, I may be able to use those in a subsequent command with "scatteri." However, I do not know how to extract the y-range of a previous graph. Is there a way to find out the y-range of a graph in memory?
My problem is that I do not know beforehand what parameters to use for the "scatteri" command. That is, I don't know the rage of y-values to use for the vertical line. After the graph is produced, I can eyeball the graph and plug in numbers, but I would like to automate the process. Is there a way to figure out what y-values to use beforehand?
I figure that if I can run the command once, without "scatteri" and then recover the y-coordinates of the plot region, I may be able to use those in a subsequent command with "scatteri." However, I do not know how to extract the y-range of a previous graph. Is there a way to find out the y-range of a graph in memory?
Comment