cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
macca5019
Level I

Font colour changes when spinning a surface plot

I've produced a surface plot using a predicted formula from a definitive screening design.

 

I'd like to present my plot in a presentation with the plot rotating. To do so I followed this thread: https://community.jmp.com/t5/Discussions/Spinning-a-Scatterplot-3D/td-p/6510

 

The advice here was originally for a scatter plot, however I got it working using the same line of code:

Set Spin( 0.01, 0, 0.01, 0 )

The spinning works fine, however when the plot is spinning the font colours change from black to a feint grey, making them more difficult to read:

 

Whilst spinningWhilst spinningWhilst stationaryWhilst stationary

Does anyone know what's causing this/if there's anything I can do to fix the problem? Or perhaps a different way to make the surface plot spin that doesn't result in this issue?

 

Thanks

3 REPLIES 3
Phil_Kay
Staff

Re: Font colour changes when spinning a surface plot

Wow! That is a really beautiful visual!

 

I get the same behaviour when I use Set Spin(). But not when I manually rotate the plot using click-and-drag.

 

I am not sure what causes this or if there is a way to fix it. You might want to contact tech support (support@jmp.com). I have pasted an example script, below, that demonstrates the issue you are talking about using Tiretread example data.

 

Other than that, you could just screen record your manual rotation of the plot.

 

Regards,

Phil

 

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Tiretread.jmp" );

obj = Surface Plot(
	Columns( :Pred Formula ABRASION ),
	Control Panel( 0 ),
	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( "Blue to Gray to Orange" ),
	Response Column Color Theme3( "Spectral" ),
	Response Column Color Theme4( "Jet" ),
	Formula( "Pred Formula ABRASION" ),
	Surface Color Method( "Solid", "Solid", "Solid", "Solid" ),
	SetVariableAxis( :SILICA, Axis Data( {} ) ),
	SetVariableAxis( :SILANE, Axis Data( {} ) ),
	SetZAxis( :Pred Formula ABRASION, Current Value( 125 ), Axis Data( {} ) ),
	SetXVariable( :SILICA ),
	SetYVariable( :SILANE ),
	Iso Value( 0, 139.119238722664 ),
	Frame3D(
		Set Graph Size( 470, 470 ),
		Set Grab Handles( 0 ),
		Set Hide Lights Border( 1 ),
		Set Rotation( -66.7809360215981, 3.32558351899253, 44.6221502352661 )
	)
);

obj << Frame3D( Set Spin( 0.1, 0, 0.01, 0 ) );
Craige_Hales
Super User

Re: Font colour changes when spinning a surface plot

It dims on purpose to make the text less distracting. The labeled axes are already switching about to stay out of the way of the graph and were hard to watch when solid black. I'm unaware of any way to disable the feature. To extend Phil's suggestion, you can script the Frame3D <<setRotation method and capture images. @Anonymous 

(Or, it is fast enough you might just run the script without capturing the images.)

dt = Open( "$SAMPLE_DATA/Tiretread.jmp" );

obj = Surface Plot(
	Columns( :Pred Formula ABRASION ),
	Control Panel( 0 ),
	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( "Blue to Gray to Orange" ),
	Response Column Color Theme3( "Spectral" ),
	Response Column Color Theme4( "Jet" ),
	Formula( "Pred Formula ABRASION" ),
	Surface Color Method( "Solid", "Solid", "Solid", "Solid" ),
	SetVariableAxis( :SILICA, Axis Data( {} ) ),
	SetVariableAxis( :SILANE, Axis Data( {} ) ),
	SetZAxis( :Pred Formula ABRASION, Current Value( 125 ), Axis Data( {} ) ),
	SetXVariable( :SILICA ),
	SetYVariable( :SILANE ),
	Iso Value( 0, 139.119238722664 ),
	Frame3D(
		Set Graph Size( 470, 470 ),
		Set Grab Handles( 0 ),
		Set Hide Lights Border( 1 ), 
		//Set Rotation( 10, 20, 30 )
	)
);

//oscillate using cosine 
ipic=0;
For( n = 1, n <= 3, n += 1,
	For( i = 0, i < 1, i += 1 / 32,
		delta = 5 * Cos( 2 * Pi() * i ); // 5 * (1..-1..1)
		obj << frame3d( setrotation( 10 + delta, 20 + delta, 30 + delta ) );
		obj << updatewindow;
		Wait( 0 );
		// take picture here if wanted
		//img = report(obj)[SceneBox(1)]<<getpicture;
		//img<<saveimage("f:/surf/surf"||right(char((ipic++)+1000000),6)||".gif","gif");
	)
);

oscillating 3D surfaceoscillating 3D surface

I used gifsicle to make the animated gif; there are many ways to turn the sequence of images into an animated gif or video.

gifsicle -O3 -d 10 --loop=0 surf*.gif >osc.gif

 

Craige
Craige_Hales
Super User

Re: Font colour changes when spinning a surface plot

The script for oscillating is written to produce a complete cycle. The cos() function gets a (nearly) complete input range from 0 to 2*pi, which makes the output range from +1 to -1 back to (nearly) +1 again. That is multiplied by 5 to produce +/- 5 degree motion. It loops, perfectly, because the next step after the last step is the first image. (If the for-i loop used <= there would be a duplicated frame.) The for-n loop is not needed for making pictures, but useful for a live demo.

You could make a tumbling demo rather than an oscillating demo without the cosine function. The oscillator uses the same delta from each of the initial x,y,z angles. As long as all the angles return to the same initial value at the end of the tumble, it will loop nicely. Something like 

setrotation( 1*2*pi()*i,3*2*pi()*i,5*2*pi()*i) for 0<i<1

where each angle goes through 1 or more complete 2pi rotations (1,3,5 as shown).

 

I think the oscillation over a small range is better for understanding. Tumbling may be better for attention grabbing.

Triple Helix spinning in 3DTriple Helix spinning in 3D

8113_ellipse.gif

Craige