如何獲取Scatterplot 3D的容器嗨,
當我在Scatterplot 3D中表示數據時,我會經常重複某些操作。例如,我更改顏色主題(顏色條),點的大小等。表是不同的但是操作是相同的,並且它們沒有引用特定的列,所以我認為操作可以自動化。
我想知道如何為已經打開的圖表編寫腳本。對於2d grahps,我可以使用,例如,此命令來引用容器:
Window( Window name )[framebox( 1 )] << set background color( "gray" );
但我無法在Scatterplot 3D中使用它。
謝謝,
大衛
Re:我如何獲得Scatterplot 3D的容器你好 @珍珠 ,
Scatterplot 3D使用Display3DBox,因此這應該用於引用該對象,以及您將用於大多數消息(設置牆壁顏色,標記,旋轉,旋轉等):
Window( Window name )[Display3DBox(1)]
如果你需要設置背景顏色,你實際上想要引用SceneBox:
Window( Window name )[SceneBox(1)]<<BACKGROUND color=""></BACKGROUND>
這是一個完整的例子,我將牆壁和背景設置為藍色:
Open( "$SAMPLE_DATA\Big Class.jmp" );
s3d = Scatterplot 3D( Y( :age, :height, :weight ), Frame3D( Set Grab Handles( 0 ) ) );
//view properties if you wish to see options
//show properties(Window( "Big Class - Scatterplot 3D" )[SceneBox(1)])
//show properties(Window( "Big Class - Scatterplot 3D" )[Display3DBox(1)])
Window( "Big Class - Scatterplot 3D" )[Display3DBox( 1 )] << Set Wall Color( 5 );
Window( "Big Class - Scatterplot 3D" )[Scene Box( 1 )] << Background color( blue );
我希望這有幫助!
@julian
Re:我如何獲得Scatterplot 3D的容器如果以交互方式更改顏色並保存腳本,Scatterplot 3D將直接將顏色記錄為腳本的一部分:
Scatterplot 3D(
Y( :age, :height, :weight ),
Frame3D(
<STRONG>Set Wall Color( -16750758 ),</STRONG>
Set Grab Handles( 0 ),
Set Rotation( -52.9429431878029, -1.24217455677765, 22.838483399832 ),
<STRONG>Background Color( 144, 191, 4 )</STRONG>
)
);
如果您在啟動平台時知道所需的顏色,這可能是最簡單的解決方案。
Re:我如何獲得Scatterplot 3D的容器你好 @julian ,
非常感謝您的回答。Display3DBox對於更改許多屬性非常有用。
但是,我仍然無法改變情節的傳說。如果我保存腳本,這就是代碼,它出現在SendToReport(Dispatch(...))下。
obj = Scatterplot 3D(
Y( :x, :y, :z ),
Coloring( :T composed 2 ),
Legend( 84 ),
Frame3D( Legend( 1 ), Set Grab Handles( 0 ), Set Rotation( -54, 0, 38 ) ),
SendToReport(
Dispatch(
{},
"100",
ScaleBox,
{Legend Model( 3, Properties( 0, {gradient( {Color Theme( "Spectral" )} )} ) )}
)
);
);你知道一種方法來訪問這些類似的屬性窗口 ( 窗口名稱 ) [ Display3DBox ( 1 ) ] ?
Re:我如何獲得Scatterplot 3D的容器謝謝 @danschikore ,正如您所說,最簡單的解決方案是更改“首選項”中的默認設置。但是,在將來更改腳本中的屬性可能對我有用。Re:我如何獲得Scatterplot 3D的容器你好 @珍珠 ,
要告訴平台調度選項,您需要一個可編寫腳本的對象(散點圖3d平臺本身)而不是報表窗口的句柄。我們可以使用<< Get Scriptable Object來幫助我們。獲得該句柄後,您可以發送保存腳本時找到的確切分派消息。這是一個完整的例子,包括我展示的以前的自定義:
Open( "$SAMPLE_DATA\Big Class.jmp" );
s3d = Scatterplot 3D( Y( :age, :height, :weight ), Coloring( :sex ), Legend( 17 ), Frame3D( Legend( 1 ) ) );
//view properties if you wish to see options
//show properties(Window( "Big Class - Scatterplot 3D" )[SceneBox(1)]);
//show properties(Window( "Big Class - Scatterplot 3D" )[Display3DBox(1)]);
//set colors, contolled in the report layer<BR />Window( "Big Class - Scatterplot 3D" )[Display3DBox( 1 )] << Set Wall Color( 5 );
Window( "Big Class - Scatterplot 3D" )[Scene Box( 1 )] << Background color( blue );
//find the scriptable object so that options can be dispatched
s3dFound = Window( "Big Class - Scatterplot 3D" )[Outline Box( 1 )] << Get Scriptable Object;
//Dispatch options by sending messages to that scriptable object
s3dFound << Dispatch(
{},
"100",
ScaleBox,
{Legend Model(
17,
Properties( 0, {Line Color( 73 ), Marker Size( 10 )}, Item ID( "F", 1 ) ),
Properties( 1, {Line Color( 45 ), Marker Size( 10 )}, Item ID( "M", 1 ) )
)}
);
@julian
Re:我如何獲得Scatterplot 3D的容器我應該補充一點,如果您首先使用腳本生成輸出,那麼您已經擁有了平台的句柄(假設您在啟動平台時已經這樣做了)。在我的例子中,那是s3d。但是,如果您有一個不是由腳本生成的窗口,則使用<< Get Scriptable Object可以建立該平台的句柄。Re:我如何獲得Scatterplot 3D的容器謝謝 @julian ,這很有意思。