Does anyone have a favorite method for doing this?
When I need to produce a graph where (x,y)=(0,0) is in the center of the graph I use a brute force approach like that used to generate the graph created by this do-file.
I suspect there are more elegant ways to do this, however.
When I need to produce a graph where (x,y)=(0,0) is in the center of the graph I use a brute force approach like that used to generate the graph created by this do-file.
I suspect there are more elegant ways to do this, however.
Code:
cap preserve cap drop _all set obs 25 gen y=runiform()-.5 gen x=runiform()-.5 scatter y x, xlab(0) ylab(0) xsc(r(-.5 .5) noline) ysc(r(-.5 .5) noline) /// xline(0) yline(0) yti(,orient(horiz)) ylab(,angle(360)) cap restore
Comment