Dear StataList,
I am trying to add a diagonal line to a twoway graph in which the x and y axes have very different ranges. For example,

When I use the function y=x option with the y axis as the range value, the x axis is extended and the line begins at the lowest observed value on the y axis:

Switching away from function to line produces essentially the same graph:

Is there a way to keep both axes as they originally are but add a diagonal line that extends from (0,0) to the upper right quadrant?
Thank you.
I am trying to add a diagonal line to a twoway graph in which the x and y axes have very different ranges. For example,
Code:
sysuse auto, clear twoway (scatter price length)
When I use the function y=x option with the y axis as the range value, the x axis is extended and the line begins at the lowest observed value on the y axis:
Code:
sysuse auto, clear twoway (scatter price length) (function y=x, range(price))
Switching away from function to line produces essentially the same graph:
Code:
sysuse auto, clear twoway (scatter price length) (line price price, sort)
Is there a way to keep both axes as they originally are but add a diagonal line that extends from (0,0) to the upper right quadrant?
Thank you.
Comment