cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
twaintwist
Level III

Saving Graph

I'd like to run JMP from the commandline on a server ---- periodically the data will be dumped from a database and invoke a JMP script --- this script will format the data via Graph Builder ---   It all appears to be working but I need a way to save the Graph Image to a file (... PDF would be fine) and close/exit JMP.....

Here is what I have;                        -----   the graph does not appear and no files created..... --- and I don't know how to close/exit JMP

//Open data table from QA system and create graph for Open Defects by severity and version number//

  dt = Open("$SAMPLE_IMPORT_DATA/GalaxyFULL_TEST.xls");

// Build the visualization Graph to show severity of open defects//

wind = New Window( header,

Graph Builder(

           .....................Graph Builder script goes here.................................

      );

wind << save picture("c:\temp\Graphic.JPG", JPEG);

wind << Close Window;

Close( dt, No Save );

1 ACCEPTED SOLUTION

Accepted Solutions
twaintwist
Level III

Re: Saving Graph

OK --- i've stepped through my script and it appears to be working now ---- not exactly sure where the problem lies.....   The following works......

// create a new directory for day of the week//

baseDir = "C:\temp\";

dir = baseDir || Substitute(MDYHMS(Today()), "/", "-", ":", ".");

CreateDirectory(dir);

Set Current Directory (dir);

// save graph to new directory//

wind << save picture("D2L Open Defects.JPG", JPEG);

wind << close Window;

Close( dt, No Save );

Exit (No Save);

View solution in original post

3 REPLIES 3
twaintwist
Level III

Re: Saving Graph

OK --- i've stepped through my script and it appears to be working now ---- not exactly sure where the problem lies.....   The following works......

// create a new directory for day of the week//

baseDir = "C:\temp\";

dir = baseDir || Substitute(MDYHMS(Today()), "/", "-", ":", ".");

CreateDirectory(dir);

Set Current Directory (dir);

// save graph to new directory//

wind << save picture("D2L Open Defects.JPG", JPEG);

wind << close Window;

Close( dt, No Save );

Exit (No Save);

ms
Super User (Alumni) ms
Super User (Alumni)

Re: Saving Graph

Although I have limited experience of Windows, is it possible that the save-error in the first script was caused by the use of a lower case drive letter in the path? As in wind << save picture("c:\temp\Graphic.JPG", JPEG);

twaintwist
Level III

Re: Saving Graph

MS ----  thanks for the suggestion ----   I tried with lower case and uppercase drive letter and it doesn't seem to make a difference...

So I'm still puzzled but at least it's working now.....