問題
我想將圖形保存為圖像以進行演示,而不使用“Graph Builder”標題。
解
在Display Box層次結構中獲取對圖形本身的引用,並將該引用發送到“保存圖片”消息。
save_graph_only = function({gb, pic_file}, {Default Locals},
rpt = gb << report;
(rpt << Child) << save picture(pic_file);
);
討論
這是一個完整的例子:
Names Default to Here(1);
save_graph_only = function({gb, pic_file}, {Default Locals},
rpt = gb << report;
(rpt << Child) << save picture(pic_file);
);
pic_file = "$TEMP/graph_no_outline.png";
dt = Open("$SAMPLE_DATA/Iris.jmp");
gb = dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :Sepal length ), Y( :Sepal width ), Overlay( :Species ) ),
Elements(
Contour( X, Y, Legend( 3 ), Number of Levels( 3 ) ),
Points( X, Y, Legend( 4 ) )
),
SendToReport(
Dispatch(
{},
"Sepal length",
ScaleBox,
{Min( 4.02451368343195 ), Max( 8.24903846153846 ), Inc( 1 ),
Minor Ticks( 0 )}
),
Dispatch(
{},
"Sepal width",
ScaleBox,
{Min( 1.75 ), Max( 5.00400457665904 ), Inc( 1 ), Minor Ticks( 0 )}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {3, [0, 1, 2], 4, [-1, -1, -1]} ),
Position( {0, 1, 2, -1, -1, -1} )}
)
)
);
save_graph_only(gb, pic_file);
dt << Close Window();
open(pic_file);
原始討論和其他信息這裡 。
也可以看看
您的鏈接在這里或刪除此行