How do I get the containers of Scatterplot 3DHi,
When I represent data in a Scatterplot 3D, I repeat some actions frequently. For example, I change the Color Theme (colorbar), the size of the points, etc. Tables are different but actions are the same and they don't refer to specific columns, so I suppose the actions can be automatized.
I wonder how to script this for graphs that are already open. For 2d grahps I can use, for example, this command to refer to the container:
Window( Window name )[framebox( 1 )] << set background color( "gray" );
but I cannot use it in a Scatterplot 3D.
Thank you,
David
Re: How do I get the containers of Scatterplot 3DHi @Pearl,
Scatterplot 3D uses a Display3DBox, so this should work to reference that object, and what you'll use for most messages (setting wall colors, markers, rotation,spin, etc):
Window( Window name )[Display3DBox(1)]
If you need to set the background color, you'll actually want to reference the SceneBox:
Window( Window name )[SceneBox(1)]<<BACKGROUND color=""></BACKGROUND>
Here's a full example where I set both the walls and background blue:
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 );
I hope this helps!
@julian
Re: How do I get the containers of Scatterplot 3DIf you change the colors interactively and save the script, Scatterplot 3D will record the colors directly as part of the script:
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>
)
);
This might be the easiest solution if you know the colors that you want when the platform is launched.
Re: How do I get the containers of Scatterplot 3DHi @julian ,
Thank you very much for your answer. Display3DBox is very useful to change many properties.
However, I still cannot change the legend of the plot. If I save the script this is the code, and it appears under 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" )} )} ) )}
)
);
);Would you know a way to access these properties similar to Window( Window name )[Display3DBox(1)]?
Re: How do I get the containers of Scatterplot 3DThank you @danschikore, as you say the easiest solution is to change the default settings in Preferences. However, changing the properties in a script could be useful for me in the future.Re: How do I get the containers of Scatterplot 3DHi @Pearl,
To tell the platform to dispatch options, you'll need a handle to the scriptable object (the scatterplot 3d platform itself) rather than the report window. We can use <
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: How do I get the containers of Scatterplot 3DI should add, if you use a script to generate the output in the first place, you'll already have a handle to the platform (assuming you did so when you launched the platform). In my example, that's s3d. But, if you have a window that is not generated by a script, using <Re: How do I get the containers of Scatterplot 3DThank you @julian, this is very interesting.