如何将用户指定的x
和y
值(无论以何种比例)映射到
屏幕坐标?这就是Stata在生成图形时在内部执行的操作。
例如:
clear
set seed 1234567890
set obs 500
generate y = rnormal(434.80132, 237.89369)
generate x = rnormal(0.08, 0.04)
twoway scatter y x
classutil describe .Graph.plotregion1
double .drawn_yalpha = 8238.730168
double .drawn_ybeta = 9.137843887999999
double .drawn_xalpha = 8797.446232487588
double .drawn_xbeta = 102552.7601697518
double .drawn_gbeta = 232.72
double .gdi_y0 = 3157.824224
double .gdi_x0 = 3157.824224
double .gdi_y1 = 22457.48
double .gdi_x1 = 31184.48
twoway scatter y x || function y = 7000*x, range(0 0.15)
classutil describe .Graph.plotregion1
double .drawn_yalpha = 9787.283955999999
double .drawn_ybeta = 8.105474695999998
double .drawn_xalpha = 8797.446232487588
double .drawn_xbeta = 102552.7601697518
double .drawn_gbeta = 232.72
double .gdi_y0 = 5222.562608
double .gdi_x0 = 3157.824224
double .gdi_y1 = 22457.48
double .gdi_x1 = 31184.48
Stata的文档没有描述如何计算所有这些。