BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
Highlighted
Thomas1
Not applicable

Standardize Graphs in Graph Builder

Is it possible to standardize graphs from graph builder, after they have been created, with regards to:

 

  • size (for example 1200 by 900 pixel)
  • axis settings (font size)
  • and title (font size)

 

by applying JSL? Are there other ways to achieve this?

0 Kudos
6 REPLIES 6
txnelson
Not applicable

Re: Standardize Graphs in Graph Builder

Here is a short script that will show you an example on how to do this....Documentation on this is in the Scripting Guide and the Scripting Index

     Help==>Books==>Scripting Guide

     Help==>Scripting Index

Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );

gb = Graph Builder(
	Size( 528, 484 ),
	Show Control Panel( 0 ),
	Variables( X( :sex ), Y( :height ), Group X( :age ) ),
	Elements( Box Plot( X, Y, Legend( 1 ) ) )
);

rgb = Report( gb );

// Set the size of the display
rgb[Frame Box( 1 )] << Frame Size( 100, 300 );

// Set the title size
rgb[Outline Box( 1 )][Text Box( 1 )] << set font size( 20 );

// Set axis font size
rgb[AxisBox( 2 )] << label row( set font size( 14 ) );
Jim
0 Kudos
Thomas1
Not applicable

Re: Standardize Graphs in Graph Builder

Thanks for the reply Jim. The scripts are pointing in the right direction.

 

Is there a general approach, were I can run for example an add in, which transforms an created graph from graph builder into defined a standard graph size, standard title and axis size?

0 Kudos
txnelson
Not applicable

Re: Standardize Graphs in Graph Builder

Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );

Graph Builder(
	Size( 528, 484 ),
	Show Control Panel( 0 ),
	Variables( X( :sex ), Y( :height ), Group X( :age ) ),
	Elements( Box Plot( X, Y, Legend( 1 ) ) )
);


// The code below could be put into an JMP Addin, and it would scan through all
// of the windows and when the first Graph Builder output window is found, it
// would set the standard settings
//
// The code could also be changed to display a list of all of the Graph Builder windows found
// and the user could then select the one(s) to set
//
// There are other issues, since the Graph Builder can produce a multitude of
// outputs.  The setting of the graph area size, will vary based upon the 
// elements within the output display.  
i = 1;
stop = "No";
While( Window( i ) << Get Window Title != {} & Stop == "No",
	If( Word( 2, Window( i ) << Get Window Title, "-" ) == " Graph Builder",
		stop = "Yes";
		Break();
	);
	i++;
);

If( stop == "Yes", 
// Set the size of the display
	Window( i )[Frame Box( 1 )] << Frame Size( 100, 300 );

// Set the title size
	Window( i )[Outline Box( 1 )][Text Box( 1 )] << set font size( 20 );

// Set axis font size
	Window( i )[AxisBox( 2 )] << label row( set font size( 14 ) );
);
Jim
0 Kudos
Thomas1
Not applicable

Re: Standardize Graphs in Graph Builder

Sorry for the late reply. I did try to built an add-in or run the code:

 

i = 1;
stop = "No";
While( Window( i ) << Get Window Title != {} & Stop == "No",
	If( Word( 2, Window( i ) << Get Window Title, "-" ) == " Graph Builder",
		stop = "Yes";
		Break();
	);
	i++;
);

If( stop == "Yes", 
// Set the size of the display
	Window( i )[Frame Box( 1 )] << Frame Size( 100, 300 );

// Set the title size
	Window( i )[Outline Box( 1 )][Text Box( 1 )] << set font size( 20 );

// Set axis font size
	Window( i )[AxisBox( 2 )] << label row( set font size( 14 ) );
);

for other data sets with open graphs in graph builder. I could't see any changes or impact on the graphs. Am I missing something?

0 Kudos
txnelson
Not applicable

Re: Standardize Graphs in Graph Builder

What I supplied was code that will work for a given example.   It is intended to show the approach that you can use to get done what you want.  However, becaue of the great number of posibilities of the output coming out of Graph Builder, the pointers to the text box() and axis box() may be totally different for alternate graphs.  You will need to examine the different outputs and then move the required code into your script.

Jim
0 Kudos
Thomas1
Not applicable

Re: Standardize Graphs in Graph Builder

Thanks for your fast reply.  According to my experience it is tricky to transfer JMP graphs that they have similar look in Power Point etc.

I'm beginner in JSL. Therefore I was hoping for a simple solution, with which I'm able to standardize a current graph from graph builder, with regards to the title, axis and graph size or format (length: width for example 3:2) and overcome the different looks in Power Point etc.

0 Kudos