cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
DMR
DMR
Level V

Auto-stretching a Contour Plot

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
ian_jmp
Level X

Re: Auto-stretching a Contour Plot

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 ) ) )

);

View solution in original post

4 REPLIES 4
ian_jmp
Level X

Re: Auto-stretching a Contour Plot

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 ) ) )

);

DMR
DMR
Level V

Re: Auto-stretching a Contour Plot

Useful to know - many thanks!

rabelardo
Level IV

Re: Auto-stretching a Contour Plot

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

- Randy

Re: Auto-stretching a Contour Plot

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);