Subscribe Bookmark RSS Feed

Saving a group of graphs

Gabriela_MJ

Occasional Contributor

Joined:

Jan 4, 2017

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
melaniedrake

Staff

Joined:

May 30, 2014

Solution

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 );
);
2 REPLIES
melaniedrake

Staff

Joined:

May 30, 2014

Solution

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

Occasional Contributor

Joined:

Jan 4, 2017

Thank you very much! :)