Subscribe Bookmark RSS Feed

Creating plots via JSL with automatic axis scaling

terapin

Community Trekker

Joined:

Jun 23, 2011

I am displaying multiple overlay plots within the JSL H and V List Box structure. I change the start and end date of the data displayed in these plots (see code snippet below) and would like the Y axis data to be automatically scaled to fit within the displayed window without have to manually change the Min and Max values each time I change the date range.  I can't find any information in the JSL scripting guide on how to accomplish this and wonder if it's possible, and if so, how?

 

 

 

sdate = Date MDY( 5, 1, 2011 );

edate = Date MDY( 5, 8, 2011 );

 

New Window( "Dendrometer Reading Plots",

    H List Box (

        V List Box(

            op1 = Overlay Plot(

                X( :Name( "Date & Time" ) ),

                Y( :Name( "Adj, Scld, AN4 Large Point, Bt NW (µm)" ), :Name( "Vapor Pressure Deficit (kPa)" ) ),

                Y Scale( Left, Right ),

                Separate Axes( 1 ),

                Connect Thru Missing( 1 )

            ),

            Report( op1 )[Frame Box( 1 )] << Frame Size( 700, 300 ),

            Report( op1 )[Axis Box( 1 )] << Axis Settings(

                {Format( "Fixed Dec", 10, 0 ), Min( -7650 ), Max( -6800 ), Inc( 50 ), Minor Ticks( 1 ), Show Major Grid( 1 )}

            ) << Remove Axis Label << Add Axis Label( "Adjusted Dendrometer Readings (um)" ),

            Report( op1 )[Axis Box( 2 )] << Axis Settings(

                {Format( "m/d/y", 10 ), Interval( "Day" ), Inc( 1 ), Minor Ticks( 0 ), Show Major Grid( 1 ), Show Minor Grid( 0 ),

                Min( sdate ), Max( edate )}

            ) << Remove Axis Label << Add Axis Label( "Date & Time" ),

            Report( op1 )[Axis Box( 3 )] << Axis Settings(

                {Format( "Fixed Dec", 10, 2 ), Min( 0 ), Max( 2 ), Inc( 0.25 ), Minor Ticks( 1 ), Show Major Grid( 1 )} ),

1 ACCEPTED SOLUTION

Accepted Solutions
wiebepo

Community Trekker

Joined:

Oct 10, 2011

Solution

To have JMP autoscale an axis min and max, be sure not to include those settings in the script. For example, if other axis format settings are desirable, specify them and exclude the min and max.

Report( op1 )[Axis Box( 3 )] << Axis Settings( 

                {Format( "Fixed Dec", 10, 2 ), Min( 0 ), Max( 2 ), Inc( 0.25 ), Minor Ticks( 1 ), Show Major Grid( 1 )} ),

becomes:

Report( op1 )[Axis Box( 3 )] << Axis Settings( 

                {Format( "Fixed Dec", 10, 2 ), Inc( 0.25 ), Minor Ticks( 1 ), Show Major Grid( 1 )} ),

2 REPLIES
wiebepo

Community Trekker

Joined:

Oct 10, 2011

Solution

To have JMP autoscale an axis min and max, be sure not to include those settings in the script. For example, if other axis format settings are desirable, specify them and exclude the min and max.

Report( op1 )[Axis Box( 3 )] << Axis Settings( 

                {Format( "Fixed Dec", 10, 2 ), Min( 0 ), Max( 2 ), Inc( 0.25 ), Minor Ticks( 1 ), Show Major Grid( 1 )} ),

becomes:

Report( op1 )[Axis Box( 3 )] << Axis Settings( 

                {Format( "Fixed Dec", 10, 2 ), Inc( 0.25 ), Minor Ticks( 1 ), Show Major Grid( 1 )} ),

GoodMan

Community Trekker

Joined:

Oct 28, 2011

Hi Terapin,

Thanks for your raising a interesting question.Here i have ever had similar question. I wonder if you would send me your JMP table so that i can test and try to find a solution.

Best regards

Kun, Leanpharma@gmail.com