Hi,
I am using the following code to try and save a picture of a varibility and time trend plots and it works but for some reason I loose the plots formatting, color/marker/legend etc. In this case Flagging_Charts_Data_Var and Flagging_Charts_Data_Bivar are the handles for my variability and time trend plots.This is probably something easy I am missing, please help, Thanks!!!
//Code to try and save my plots as png
Summary_Data_Flagging_Window = HListBox(Flagging_Charts_Data_Var,Flagging_Charts_Data_Bivar);
Summary_Data_Flagging_Window << Save Picture(file_name,png);
Congratulations!
My first thought is that the plots might not be finished drawing with your custom formatting before the picture is saved. I am not taken the time to understand exactly when it is necessary but I make a point to send '<< update window' before every image capture or save just to be safe.
This is an overly complex example, but this 3D Plot Tools add-in uses update window. You can jump right to the source code on GitHub; search for "update window" to find the relevent lines (currently 145-148). In this case, the update window message is sent to a 'Scatterplot 3D' window before the graph inside that window is captured as an image.
//rotate the scatterplot
sp[1] << Frame3d( Set Rotation( x, y, z ) );
//make sure the plot is redrawn
sp[1] << update window;
//take a picture
img = (sp[1] << Find( Picture Box(1) )) << Get Picture;
Thanks for the reply, I don't think that the speed is the issue, I am think that there is something with the way you have to send the plot to the save picture() command but I am not familiar enough with JMP to know the answer, please if anyone else can help? Thanks, Matt
Matt,
Try the attached script. You will need to change the path, if you do not have a c:/temp/ drive. Check to see if the color of the saved was removed.
Based upon experience, I have seen only these problems regarding colors:
So if the attached script saves the colors, and you are saving the pictures before closing or changing row states, then it might be the way you reference the graphs. If the colors are stripped from the twopics.png, then it is a system thing.
You should note your OS and version of JMP. Good Luck
Thanks for the excellent explanation and help, when I run the script you attached it works fine, however when I updated my code it created .png file's that were blank, maybe I am still missing something? Should I not be using outlinebox[1]? I am using JMP Pro 11.1.1 on Win8. I am also putting the entire code inside a loop to create multiple .png pictures, do I need to update the varpic or bivpic variables every time through the loop or the summarywindow? Thanks so much again I think it is getting closer.
nevermind figure it out, Thanks again!!!
Congratulations!