Saving a group of graphsHello, 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)
Re: Saving a group of graphsThank you very much!
Re: Saving a group of graphsIf 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 );
);
Re: Saving a group of graphsThanks 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");