Subscribe Bookmark RSS Feed

Auto-stretching a Contour Plot

dqr2

Community Trekker

Joined:

Jun 19, 2015

I'd like to create a Contour Plot which incorporates the functionality for fitting the chart to the size of the window containing it (i.e. if the user enlarges the window, the chart expands automatically to fill the available space).  If it were a Graph Box, this could be done by setting the "<< auto stretching(1, 1)" property, but that doesn't seem to work with a Contour Plot.  Can it be done?  And if so, how?

Just as an aside, the Bubble Plot has an option called "Fit to Window" which seems to perform this same function, and I've tried simply applying this same syntax to the Contour Plot, but without success.

Many thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

I realise it doesn't have the full flexibility of the Contour Plot platform, but if you can live with Graph Builder then you get the desired behaviour for free:

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

cp = dt << Graph Builder(

Size( 732, 661 ),

Show Control Panel( 0 ),

Variables( X( :X ), Y( :Y ), Color( :Z ) ),

Elements( Contour( X, Y, Legend( 5 ), Number of Levels( 10 ) ) )

);

4 REPLIES
Solution

I realise it doesn't have the full flexibility of the Contour Plot platform, but if you can live with Graph Builder then you get the desired behaviour for free:

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

cp = dt << Graph Builder(

Size( 732, 661 ),

Show Control Panel( 0 ),

Variables( X( :X ), Y( :Y ), Color( :Z ) ),

Elements( Contour( X, Y, Legend( 5 ), Number of Levels( 10 ) ) )

);

dqr2

Community Trekker

Joined:

Jun 19, 2015

Useful to know - many thanks!

rabelardo

Community Trekker

Joined:

Mar 30, 2016

Adding to what Ian said, the Fit to Window option only works with Graph Builder, Bubble plot and Surface plot (fig. 1).

This is based on the JMP help and Scripting index.

A workaround I found for auto-stretching the Contour plot is by dragging the right border of the graph (fig. 2).

fig. 1

11631_Untitled.png

fig. 2

11632_contour.gif

danschikore

Staff

Joined:

Sep 21, 2012

If for some reason Graph Builder contours do not suffice, Contour Plot can be made auto-stretching by sending a JSL message to the Frame Box:

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

contour = dt<<Run Script("Contour Plot");

report = (contour<<Report);

report[FrameBox(1)] << Set Auto Stretching(1,1);