Dear All, is there any way to control the sequence order of drawing a graph (aka z-order), so that the reference line is placed on top of the graph?
Consider the following example, quite naturally one would expect the line to be on top of the area.
I have already tried to place an invisible scatter on top and add a refline there, but it seems that Stata first merges all the layers and then sinks the reflines to the very bottom of the z-order.
I am obviously trying to avoid manual calculation of the coordinates like: twoway area pc n || scatteri 0 30 500000 30, lpattern(--) recast(line)
Any workarounds for this?
Thank you, Sergiy Radyakin

Consider the following example, quite naturally one would expect the line to be on top of the area.
I have already tried to place an invisible scatter on top and add a refline there, but it seems that Stata first merges all the layers and then sinks the reflines to the very bottom of the z-order.
I am obviously trying to avoid manual calculation of the coordinates like: twoway area pc n || scatteri 0 30 500000 30, lpattern(--) recast(line)
Any workarounds for this?
Thank you, Sergiy Radyakin
Code:
clear all sysuse auto sort price, stable generate n=_n generate pc=price in 1 replace pc=price + pc[_n-1] in 2/L twoway area pc n, xline(30, lpattern(--))
Comment