BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
nqj

Community Trekker

Joined:

May 19, 2017

3D Scatterplot Animation

Hey all,

 

I need to be able to show the change in coordinates of my x,y,z data points over time in my 3D scatter plot. I am trying to adapt the animation scripts found here 

https://community.jmp.com/t5/JMP-Scripts/Save-a-Data-Filter-animation-as-an-animated-GIF/ta-p/24003/...

and here

https://community.jmp.com/t5/JMP-Scripts/Save-a-Bubble-Plot-animation-as-an-animated-GIF/ta-p/24038/..., but am having some difficulty.

 

I have a data table of x,y,z coordinates. Essentially, I want to open the table, grab a picture of the data, shift the data slightly, then grab another picture, until the final time point is reached. Is it possible to use the approach used here in the 3D Scatterplot frame? Thanks for any and all help.

 

Best,

Noah

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Re: 3D Scatterplot Animation

All you have to do is to use the Column Switcher.  To open it, just go to the red triangle and select:

    Redo==>Column Switcher

Below is a script that illustrates how to set this up in a script

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
Scatterplot 3D(
	Y( :IVP2, :PNP1, :NPN2 ),
	Frame3D( Set Grab Handles( 0 ), Set Rotation( -54, 0, 38 ) ),
	Column Switcher(
		:IVP2,
		{:IVP1, :PNP4, :NPN3, :IVP2, :NPN4, :SIT1, :INM1, :INM2, :VPM1, :VPM2,
		:VPM3, :PMS1, :SNM1, :SPM1, :NPN5, :EP2, :ZD6, :PBA, :PLG, :CAP, :PBA 2,
		:PLG 2, :PNP5, :NPN6, :PNP6, :PNP7, :NPN7, :PNP8, :IVP3, :IVP4, :IVP5,
		:IVP6, :PNP9, :NPN8, :NPN9, :IVP7, :NPN10, :N_1, :PBA1, :WPR1, :B10, :PLY10,
		:VBE210, :VTN210, :VTP210, :SIT2, :SIT3, :INV2, :INV3, :INV4, :INV5, :FST1,
		:FST2, :RES1, :RES2, :PNM1, :PPM1, :FNM1, :FPM1, :FST3, :FST4, :RES3, :RES4,
		:A1, :B1, :A2N, :A2P, :A2P1, :IVP8, :IVP9, :DE_H1, :NF_H1, :ESM1, :ESM2,
		:ESP1, :YFU1, :VPM4, :PBA2, :PBB1, :LYA1, :LYB1, :DEM1, :DEP1, :NFM1, :PLY1,
		:VDP1, :VDP2, :SNW1, :RSP2, :PLY2, :RSP1, :VDP3, :PBL1, :PLG1, :VDP4, :SPW1,
		:VIA1, :INM3, :VPM5, :VPM6, :INM4, :VPM7, :M1_M1, :M2_M2, :P1_P1, :E2A1,
		:E2B1, :NPN11, :IVP10, :PNP10, :INM5, :VPM8, :VPM9, :INM6, :VPM10, :N2A1,
		:N2B1, :NM_L1, :P2A1, :P2B1, :PM_L1, :P1, :M1}
	)
);

columnswitcher.PNG

Jim
5 REPLIES 5
txnelson

Super User

Joined:

Jun 22, 2012

Re: 3D Scatterplot Animation

Here is the example from the Scripting Index on how to set and move the rotation of a Scatterplot 3D

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Iris.jmp" );
obj = Scatterplot 3D(
	Y(
		:Sepal length,
		:Sepal width,
		:Petal length,
		:Petal width
	)
);
obj << Frame3D( Set Rotation( -60, -3, 35 ) );
Jim
nqj

Community Trekker

Joined:

May 19, 2017

Re: 3D Scatterplot Animation

Thank you, however I don't need to move the scatter plot itself, rather I would like to plot different data in each frame so as to make it look like the data approaches a specific shape. Is there a simple way to do this?

ih

Community Trekker

Joined:

Sep 30, 2016

Re: 3D Scatterplot Animation

If you are in windows take a look at the script attached to this post. You could replace the logic on lines 35-41 with your own script to add more data to the plot as a function of the variable 'frame'.

txnelson

Super User

Joined:

Jun 22, 2012

Solution

Re: 3D Scatterplot Animation

All you have to do is to use the Column Switcher.  To open it, just go to the red triangle and select:

    Redo==>Column Switcher

Below is a script that illustrates how to set this up in a script

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
Scatterplot 3D(
	Y( :IVP2, :PNP1, :NPN2 ),
	Frame3D( Set Grab Handles( 0 ), Set Rotation( -54, 0, 38 ) ),
	Column Switcher(
		:IVP2,
		{:IVP1, :PNP4, :NPN3, :IVP2, :NPN4, :SIT1, :INM1, :INM2, :VPM1, :VPM2,
		:VPM3, :PMS1, :SNM1, :SPM1, :NPN5, :EP2, :ZD6, :PBA, :PLG, :CAP, :PBA 2,
		:PLG 2, :PNP5, :NPN6, :PNP6, :PNP7, :NPN7, :PNP8, :IVP3, :IVP4, :IVP5,
		:IVP6, :PNP9, :NPN8, :NPN9, :IVP7, :NPN10, :N_1, :PBA1, :WPR1, :B10, :PLY10,
		:VBE210, :VTN210, :VTP210, :SIT2, :SIT3, :INV2, :INV3, :INV4, :INV5, :FST1,
		:FST2, :RES1, :RES2, :PNM1, :PPM1, :FNM1, :FPM1, :FST3, :FST4, :RES3, :RES4,
		:A1, :B1, :A2N, :A2P, :A2P1, :IVP8, :IVP9, :DE_H1, :NF_H1, :ESM1, :ESM2,
		:ESP1, :YFU1, :VPM4, :PBA2, :PBB1, :LYA1, :LYB1, :DEM1, :DEP1, :NFM1, :PLY1,
		:VDP1, :VDP2, :SNW1, :RSP2, :PLY2, :RSP1, :VDP3, :PBL1, :PLG1, :VDP4, :SPW1,
		:VIA1, :INM3, :VPM5, :VPM6, :INM4, :VPM7, :M1_M1, :M2_M2, :P1_P1, :E2A1,
		:E2B1, :NPN11, :IVP10, :PNP10, :INM5, :VPM8, :VPM9, :INM6, :VPM10, :N2A1,
		:N2B1, :NM_L1, :P2A1, :P2B1, :PM_L1, :P1, :M1}
	)
);

columnswitcher.PNG

Jim
Peter_Bartell

Joined:

Jun 5, 2014

Re: 3D Scatterplot Animation

nqj: Or maybe another way to accomplish your visualization goal is through an animated bubble plot? You can change bubble size, location, coloring, etc. and if convergence of the variables to some specific end point is what you are after, perhaps this style of visualization might work as well? I'm thinking as an example the Napoleans March.jmp data table in the JMP sample data directory as something that might show what's possible? Multiple variables, moving in a 2 dimensional plane, but changing color and size based on other variables. Convergence also is shown. Plus if you share with others people can play with the animation as part of the report.