cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Gabriela_MJ
Level I

Saving a group of graphs

Hello, I have the script for creating different contour plots that I need. I have to save each of them as .jpg. I tried to do that by using the following script, however it only save the last one. Can anybody help me? I am a new used of JMP and I think the challenge is that this script will be used for different data tables so that it is necessary to save the pictures in an automatic way because not in all the cases the number of plots will be the same.

 

Thanks in advance 

 

 

obj=Contour Plot(
X( :DIE_IDX_ABS_X, :DIE_IDX_ABS_Y ),
Y( :CD_R4_um ),
Show Data Points( 1 ),
Fill Areas( 1 ),
Label Contours( 0 ),
By( :Width_CD, :DUPLO_WAFER_ID ),
Transform( "None" )
);


obj << save picture( "Wafer.jpg", jpeg ); // picture name

close(dt)

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Saving a group of graphs

If you look at your conour plot object (try a Show(obj)) you'll see that you have a list of contour plots.

 

When you send a message to a list, the message is sent to each item in the list. Since you're sending a save message, each item in the list is getting saved, but they are all being saved to the same file name. The last one "wins".

 

To save each plot as a picture, process the list of plots one at a time. Try using this loop instead of your save statement. 

 

For( i = 1, i <= N Items(obj), i++, 
	name = "Wafer" || Char(i) || ".jpg"; // make a unique name for each picture
	obj[i] << save picture( name, jpeg );
);

View solution in original post

4 REPLIES 4

Re: Saving a group of graphs

If you look at your conour plot object (try a Show(obj)) you'll see that you have a list of contour plots.

 

When you send a message to a list, the message is sent to each item in the list. Since you're sending a save message, each item in the list is getting saved, but they are all being saved to the same file name. The last one "wins".

 

To save each plot as a picture, process the list of plots one at a time. Try using this loop instead of your save statement. 

 

For( i = 1, i <= N Items(obj), i++, 
	name = "Wafer" || Char(i) || ".jpg"; // make a unique name for each picture
	obj[i] << save picture( name, jpeg );
);
Gabriela_MJ
Level I

Re: Saving a group of graphs

Thank you very much! :)
Setsuna
Level II

Re: Saving a group of graphs

Thanks for your explanation! But I'm wondering is there a method to save the whole report as a single picture, just like we do File -> Export -> Image?

Re: Saving a group of graphs

@Setsuna - you can use any one of the resulting platforms to find the top-most box in the window, and save the picture from there:

dt=Open("$SAMPLE_DATA/Iris.jmp");
cp = dt << Contour Plot(
	SendToByGroup( {:Species == "setosa"} ),
	X( :Sepal length, :Sepal width ),
	Y( :Petal length ),
	Show Data Points( 0 ),
	Fill Areas( 0 ),
	Label Contours( 0 ),
	Transform( "Range Normalized" ),
	By( :Species )
);
(cp[1] << Top Report) << Save Picture("$TEMP/contours.png");
Open("$TEMP/contours.png");