cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
gianpaolo
Level IV

"make table of graphs like this"

Good morning

i would like to script this JMP function   "make table of graphs like this" , order to save my picture directly into the associated JMP table.

someone can help me

 

 

Gianpaolo Polsinelli
1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: "make table of graphs like this"

This example does the work one-at-a-time because it looks like you might have some specific requirements about what data you want to keep.

dt = Open( "$sample_data/big class.jmp" );
picDt = New Table( "dist pics",  New Column( "pics", Expression, "None", Set Values( {} ),Set Display Width( 250 ) ) );

ages = {14, 16, 17};

For( j = 1, j <= N Items( ages ), j++,
	dt << Select Where( dt:age == ages[j] );
	subsetDt = dt << subset( output table name( Char( ages[j] ) ) );
	dist = subsetDt << Distribution(
		Continuous Distribution( Column( subsetDt:weight ), Quantiles( 0 ), Summary Statistics( 0 ), Outlier Box Plot( 0 ) )
	);
	pic = (Report( dist )[Outline Box( "weight" )]) << getpicture;
	dist << closewindow();
	Close( subsetDt, "nosave" );
	picDt << addrows( 1 );
	picDt:pics[j] = pic;
);


picDt<<Set Cell Height( 100 );

Three distribution pictures in a tableThree distribution pictures in a table

Use JSL variables to keep track of the tables: dt, subsetDt, picDt. JSL often needs you to be specific about the table when there is more than one being used.

 

Craige

View solution in original post

2 REPLIES 2
gianpaolo
Level IV

Re: "make table of graphs like this"

in oder to better undrstand the issue. i report part of my script:

 

 

// the entire loop scan a table and  for each subchart  create graph// 
For( j = 1, j <= N Items( chart_title ), j++,
selectDT[1] << Select Where( :SPC_Chart == chart_title[j] );
  
display = selectDT[1] << subset( output table name( chart_title[j] ) );
display( j ) << Get name;
test_CTRL; // this is an expression  that make some graphs
);

 

 

so, i would like caputure the graph created by test_CTRL and save it in a data table using make table of graphs like this

 

/*New Table( "Chart",
 
Add Rows( 1 ),
New Column( "P", Expression, "None", Set Values( {New Image( Char To Blob( a ), "png" )} ) ),
New Column( "Y", Character, "Nominal", Set Values( chart_title[j] ) )
)*/
);
 

 

 

Gianpaolo Polsinelli
Craige_Hales
Super User

Re: "make table of graphs like this"

This example does the work one-at-a-time because it looks like you might have some specific requirements about what data you want to keep.

dt = Open( "$sample_data/big class.jmp" );
picDt = New Table( "dist pics",  New Column( "pics", Expression, "None", Set Values( {} ),Set Display Width( 250 ) ) );

ages = {14, 16, 17};

For( j = 1, j <= N Items( ages ), j++,
	dt << Select Where( dt:age == ages[j] );
	subsetDt = dt << subset( output table name( Char( ages[j] ) ) );
	dist = subsetDt << Distribution(
		Continuous Distribution( Column( subsetDt:weight ), Quantiles( 0 ), Summary Statistics( 0 ), Outlier Box Plot( 0 ) )
	);
	pic = (Report( dist )[Outline Box( "weight" )]) << getpicture;
	dist << closewindow();
	Close( subsetDt, "nosave" );
	picDt << addrows( 1 );
	picDt:pics[j] = pic;
);


picDt<<Set Cell Height( 100 );

Three distribution pictures in a tableThree distribution pictures in a table

Use JSL variables to keep track of the tables: dt, subsetDt, picDt. JSL often needs you to be specific about the table when there is more than one being used.

 

Craige