Subscribe Bookmark RSS Feed

How can I retrieve a script from an already existing graph

bellesabi

Community Trekker

Joined:

Aug 5, 2015

Hello,

I've been searching every where, I cannot seem to find a solution to my problem.

The user opens a datatable and creates all the graphes he needs and the idea is to be able to write a script that will save the picture of each graph individually in a folder on my computer.

I had difficulties first finding a way to select each graph one after another (but that seems possible by saving all the graphs on a journal).

Once all my graphs are on the journal I manage to refer to each buttonbox but I cannot seem to find a way to access the script of the graph present for each button box (to add a line <<save picture("name of graph.jpg",JPEG) )

What am I missing?

Thank you,

Isabelle

5 REPLIES
gutloja

Community Trekker

Joined:

Jul 31, 2015

Hello, Bellesabi.

Perhaps I am simplifying your question, but for a few graphs, I simply do this:

9414_Screen Shot 2015-08-05 at 12.44.26 PM.png

Then press "Shift + CMD + N" [In a Mac] to open a New Script Editor, and paste the script, then save the script on a master document for further editing.

There is also the option "Save Script to Data Table", also useful.

I would love to know if there is a way to export as ".jpeg", in File>Export, I only see the following options:9415_Screen Shot 2015-08-05 at 12.48.12 PM.png

-Jose

ryan_dewitt

Community Manager

Joined:

Jun 26, 2014

To add to this...It appears you're using JMP for Mac if you're Exporting. I'm using JMP for Windows which has a jpeg option, however it's under File>Save As not Export like on a Mac, an OS differenceI've found .pngs are pretty universal and highly beneficial if you need transparency, and is my go to graphic output. 

If your goal is a presentation, you can quickly use the large plus + tool to highlight a graph, right-click and copy then paste into your presentation or doc and repeat. If your goal is editing, retrieval or combination scripts, as nicely mentioned above you can copy a script or use red triangle Save Script to Data Table then Edit that script.  Thanks for helping out guys.

Ryan DeWitt
Community Manager | Learning Content Specialist | SAS JMP Customer Care
jenkins_macedo

Community Trekker

Joined:

Jul 13, 2015

Hi Isabelle,

First you can find the script for each graph by clicking the red triangle associated with the graph produced. Or if the graph has already been produced by someone else and once it JMP, you should be able to follow the same procedure to access the scripts for each graph. In the example below, I used the animal sample data and ran a distribution analysis on animal species by season.

9412_Script-Copy Script.jpg

Jenkins Macedo
bellesabi

Community Trekker

Joined:

Aug 5, 2015

Hello,

Thank you for both the tips.

But I was looking for an automatic solution (I have a lot of graphs for which I have to do that)....

ian_jmp

Staff

Joined:

Jun 23, 2011

If I understand correctly, this code fragment may help. It will save the contents of all currently open reports (to the Desktop):

NamesDefaultToHere(1);

w = Window();

for(i = 1, i<=NItems(w), i++,

  winTitle = w[i] << getWindowTitle;

  if((w[i] << windowClassName) == "Report", w[i] << savePicture("$DESKTOP/"||winTitle, PNG));

);