SAS:绘制没有时间序列的重叠图
SAS: Plotting overlayed graphs without time series
我认为 SAS 中的绘图引擎并不是很简单。我希望有人可以帮助我:
我想绘制 4 种不同股票的订单簿的数量。但它只是画出奇怪的点。
我有以下示例数据集:
Stock AskVolume1 AskVolume2 AskVolume3 BidVolume1 BidVolume2
BidVolume3 AskScaledPrice1 AskScaledPrice2 AskScaledPrice3
BidScaledPrice1 BidScaledPrice2 BidScaledPrice3
StockA 1 2 3 1 2 3 -9.7 -9.8 -9.9 9.7 9.8 9.9
StockB 2 4 6 2 4 6 -9.6 -9.7 -9.9 9.5 9.6 9.8
StockC etc...
横轴应显示价格,10 在中点。交易量应该在垂直轴上(图表最后应该看起来像一个 V,每只股票一个 V 形图)。
我的代码不起作用:
goptions reset=all noborder ctext=CX000000 htext=20 pt
colors=(CX0000FF CXFF0000 CX008080 CX00FF00 CXFF00FF CXFFFF00 CX00FFFF CX800000 CX008000
CX800080 CX000080 CX808000 CXFFFFFF CX808080 CXC0C0C0 CX000000);
ods _all_ close; ods listing device=png ;
filename myfile "&DIRECTORY.\output.png";
title1 justify=center color=CX000000 height=14 pt "OrderBook Shapes";
/* set the graphics environment */
goptions reset=global gunit=pct border
ftext=swissb htitle=6 htext=3;
/* set the graphics device */
goptions device=ps300 rotate=landscape ;
/* define titles and footnotes */
title1 'OrderBooks';
/* define symbol characteristics */
symbol1 color=black interpol=join value=dot height=2;
symbol2 color=black interpol=join value=diamond height=3;
/* generate two plots */
proc gplot data=plot2;
plot
BidVolume1*Price1=stock BidVolume2*price2=stock (....etc)
AskVolume1*Price1=stock AskVolume2*price2=stock (....etc)
/ overlay;
run;
感谢您的任何意见!
问题是您正在尝试将 y*x=z 图与叠加选项一起使用。根据文档页面,这是不支持的:
http://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#gplot-plot.htm
OVERLAY is not enabled with plot requests of the form
y-variable*x-variable=third-variable.
我建议您改为将股票和 bid/volume 数字 (1-3) 连接成一个分类变量,然后将其用作您的 z 变量,而不使用叠加选项。
如果您的 SAS 版本支持,您可能还想考虑使用 proc sgplot,因为 proc gplot 非常旧并且没有很好的记录。
我认为 SAS 中的绘图引擎并不是很简单。我希望有人可以帮助我:
我想绘制 4 种不同股票的订单簿的数量。但它只是画出奇怪的点。 我有以下示例数据集:
Stock AskVolume1 AskVolume2 AskVolume3 BidVolume1 BidVolume2 BidVolume3 AskScaledPrice1 AskScaledPrice2 AskScaledPrice3 BidScaledPrice1 BidScaledPrice2 BidScaledPrice3
StockA 1 2 3 1 2 3 -9.7 -9.8 -9.9 9.7 9.8 9.9
StockB 2 4 6 2 4 6 -9.6 -9.7 -9.9 9.5 9.6 9.8
StockC etc...
横轴应显示价格,10 在中点。交易量应该在垂直轴上(图表最后应该看起来像一个 V,每只股票一个 V 形图)。
我的代码不起作用:
goptions reset=all noborder ctext=CX000000 htext=20 pt
colors=(CX0000FF CXFF0000 CX008080 CX00FF00 CXFF00FF CXFFFF00 CX00FFFF CX800000 CX008000
CX800080 CX000080 CX808000 CXFFFFFF CX808080 CXC0C0C0 CX000000);
ods _all_ close; ods listing device=png ;
filename myfile "&DIRECTORY.\output.png";
title1 justify=center color=CX000000 height=14 pt "OrderBook Shapes";
/* set the graphics environment */
goptions reset=global gunit=pct border
ftext=swissb htitle=6 htext=3;
/* set the graphics device */
goptions device=ps300 rotate=landscape ;
/* define titles and footnotes */
title1 'OrderBooks';
/* define symbol characteristics */
symbol1 color=black interpol=join value=dot height=2;
symbol2 color=black interpol=join value=diamond height=3;
/* generate two plots */
proc gplot data=plot2;
plot
BidVolume1*Price1=stock BidVolume2*price2=stock (....etc)
AskVolume1*Price1=stock AskVolume2*price2=stock (....etc)
/ overlay;
run;
感谢您的任何意见!
问题是您正在尝试将 y*x=z 图与叠加选项一起使用。根据文档页面,这是不支持的: http://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#gplot-plot.htm
OVERLAY is not enabled with plot requests of the form y-variable*x-variable=third-variable.
我建议您改为将股票和 bid/volume 数字 (1-3) 连接成一个分类变量,然后将其用作您的 z 变量,而不使用叠加选项。
如果您的 SAS 版本支持,您可能还想考虑使用 proc sgplot,因为 proc gplot 非常旧并且没有很好的记录。