/ *目標
在3D曲面圖中,可以通過右鍵單擊並例如在圖形中設置標記的設置。標記規模,標記質量等。一張圖很容易。如果您有一個具有多個組的“按組”,則必須為每個圖形再次手動執行此操作,沒有控制鍵可用於復制。
那麼如何將設置選項(例如“標記比例”和“標記質量”)複製到所有其他標記中?
* /
/ *想法
我考慮過保存腳本並將此腳本用作表達式,在其中可以替換Frame3D屬性,以便獲得所需的選項。或替代。在“獲取腳本”命令的輸出中包含“ ScaleBox”和“ ScaleBox(設置標記Scale(5),設置標記質量(0)),ScaleBox”。
另一個想法是使用XPath,但我無法實現自動化。我用了
r_sp [Box(1)] [ListBox(2)] [PictureBox(1)] [ScaleBox(1)] [Display3DBox(1)] <<設置標記比例(5)
它對第一個有效,但對所有其他無效,因為我無法弄清楚如何擺脫索引。
* /
附加了一個腳本,在其中測試了一些方法。除了將零件複製到ByGroup部分中然後再次運行腳本之外,我將不勝感激。該示例有3個組,但用例有大約90個組。
謝謝,
馬丁
/* Objective
In a 3D surface Plot one can set the settings for Markers in the graph by right click and e.g. Marker Scale, Marker Quality and so forth. This is easy for one graph. If you have a by Group with many groups you have to do this for each graph manually again, no control key works for replication.
So how to replicate setting the option e.g. for Marker Scale and Marker Quality to all others???
*/
/* Ideas
I thought about saving the script and use this script as an expression where I could substitute Frame3D properties so that I have the desired options. Or substitute . "ScaleBox" with "ScaleBox(Set Marker Scale(5), Set Marker Quality(0)), ScaleBox" which is within the output of the Get Script command.
Another idea was to use XPath, but I failed to automate things. I used
r_sp[Box(1)][ListBox(2)][PictureBox(1)][ScaleBox(1)][Display3DBox(1)] << Set Marker Scale (5)
which worked for the first but not all others as I couldn't figure out how to get rid of the indices.
*/
Names Default to Here(1);
// Generate table and report (3D Plot) - this usually is done manually
dt = Open("$SAMPLE_DATA/Iris.jmp");
// Surface Plot, Goal is to set Marker Quality for all ByGroups to 0. Currently it is just for the first group.
sp = dt << Surface Plot(
SendToByGroup( {:Species == "setosa"} ),
Columns( :Sepal length, :Sepal width, :Petal length ),
Datapoints Choice( "Points" ),
Response( :Petal length ),
SetVariableAxis( :Sepal length, Axis Data( {} ) ),
SetVariableAxis( :Sepal width, Axis Data( {} ) ),
SendToByGroup( {:Species == "setosa"}, SetZAxis( z#1, Current Value( 1.45 ) ) ),
SendToByGroup(
{:Species == "versicolor"},
SetZAxis( z#1, Current Value( 4.125 ) )
),
SendToByGroup(
{:Species == "virginica"},
SetZAxis( z#1, Current Value( 5.75 ) )
),
SetXVariable( :Sepal length ),
SetYVariable( :Sepal width ),
SendToByGroup(
{:Species == "setosa"},
Frame3D(
Set Rotation( -54, 0, 38 ),
Set Marker Quality( 0 ),
Set Marker Scale( 1.585 )
)
),
SendToByGroup(
{:Species == "versicolor"},
Frame3D( Set Rotation( -54, 0, 38 ) )
),
SendToByGroup(
{:Species == "virginica"},
Frame3D( Set Rotation( -54, 0, 38 ) )
),
By( :Species )
);
// Get report
r_sp = sp << report();
// usually one would need to use:
// r_sp = currentreport();
// idea 1: Build Expression and to be substituted with string
reportExpr = Expr(
Surface Plot(
SendToByGroup( {:Species == "setosa"} ),
Columns( :Sepal length, :Sepal width, :Petal length ),
Datapoints Choice( "Points" ),
Response( :Petal length ),
SetVariableAxis( :Sepal length, Axis Data( {} ) ),
SetVariableAxis( :Sepal width, Axis Data( {} ) ),
SendToByGroup( {:Species == "setosa"}, SetZAxis( z#1, Current Value( 1.45 ) ) ),
SendToByGroup( {:Species == "versicolor"}, SetZAxis( z#1, Current Value( 4.125 ) ) ),
SendToByGroup( {:Species == "virginica"}, SetZAxis( z#1, Current Value( 5.75 ) ) ),
SetXVariable( :Sepal length ),
SetYVariable( :Sepal width ),
SendToByGroup(
{:Species == "setosa"},
Frame3D( _property_ )
),
SendToByGroup( {:Species == "versicolor"}, Frame3D( _property_ ) ),
SendToByGroup( {:Species == "virginica"}, Frame3D( _property_ ) ),
By( :Species )
)
);
ReplaceWith = "Set Rotation( -54, 0, 38 ),Set Marker Quality( 0 ), Set Marker Scale( 5 )" ;
// NameExpr(reportExpr);
tmp = Substitute(
NameExpr( reportExpr),
Expr( _property_ ), ReplaceWith,
);
// This does not work as there are "..." included which throws an error obviously. I checked different approaches but gave up and ask now :)
// eval( tmp );
// idea 3: Get script and change the code, however I failed and in addition was not sure how to change the report with the new script
myExpr = r_sp << Get Script;
// what next?嗨,馬丁,
我認為這可以做到。
但是,我確實注意到它可在Windows主機上運行,但對Mac主機似乎無效。
也許這與在每個主機上使用Open GL的方式有關。
新增中 @Paul_Nelson 看看他是否可以添加更多洞察力來託管依賴項。
斯坦
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Iris.jmp");
sp = dt << Surface Plot(
SendToByGroup( {:Species == "setosa"} ),
Columns( :Sepal length, :Sepal width, :Petal length, :Petal width ),
Datapoints Choice( "Points" ),
Surface Color Theme( "Green to Black to Red" ),
Surface Color Theme2( "Green to White to Red" ),
Surface Color Theme3( "White to Black" ),
Surface Color Theme4( "Blue to Gray to Red" ),
Response Column Color Theme( "Blue to Green to Red" ),
Response Column Color Theme2( "Spectral" ),
Response Column Color Theme3( "Jet" ),
Response Column Color Theme4( "White to Blue" ),
Response( :Petal length ),
Surface Color Method( "Solid", "Solid", "Solid", "Solid" ),
SetVariableAxis( :Sepal length, Axis Data( {} ) ),
SetVariableAxis( :Sepal width, Axis Data( {} ) ),
SendToByGroup(
{:Species == "setosa"},
SetZAxis( Petal length, Current Value( 1.45 ), Axis Data( {} ) )
),
SendToByGroup(
{:Species == "versicolor"},
SetZAxis( Petal length, Current Value( 4.125 ), Axis Data( {} ) )
),
SendToByGroup(
{:Species == "virginica"},
SetZAxis( Petal length, Current Value( 5.75 ), Axis Data( {} ) )
),
SetXVariable( :Sepal length ),
SetYVariable( :Sepal width ),
Frame3D(
Set Walls( 1 ),
Set Rotation( -54, 0, 38 ),
Set Text Scale( 2 ),
Set Line Scale( 1 ),
Set Marker Transparency( 1 ),
Set Marker Quality( 0 ),
Set Marker Scale( 1 ),
Set View Perspective( 0.1 ),
Set View Zoom( 1 )
),
By( :Species )
);
After running script and check on settings運行腳本並檢查設置後