Data visualization with SAS programming

Best way to get graphs into Powerpoint for presentation/publcation?

Accepted Solution Solved
Reply
Contributor
Posts: 64
Accepted Solution

Best way to get graphs into Powerpoint for presentation/publcation?

I've figured out that I have to save the Results in RTF format, then copy the graph and Paste-special into Powerpoint as Picture (Enhanced Metafile), ungroup several times, then start the clean-up for presentation and/or publication. Does anyone have a better solution?

 

Will


Accepted Solutions
Solution
‎01-05-2017 02:19 PM
Contributor
Posts: 64

Re: Best way to get graphs into Powerpoint for presentation/publcation?

Thanks for all the feedback, guys.  I have posted this in the University Edition forum.  Maybe someone from SAS will see it there and help out, but if not, I can live with saving as RTF, then copy-specialing into Powerpoint and ungrouping.  Reeza's early suggestion for creating completely separate graphs of each series using by-group processing is also a good way to get the elements of each series clear of all the other series, so it can be grouped and then added animination-wise to a full plot.

View solution in original post


All Replies
Super User
Posts: 17,775

Re: Best way to get graphs into Powerpoint for presentation/publcation?

Why use RTF? Output straight to PowerPoint.

Code samples are at the bottom of the page.  

 

http://support.sas.com/documentation/cdl/en/odsug/69832/HTML/default/viewer.htm#p1756mh7e3niunn15ptv...

Contributor
Posts: 64

Re: Best way to get graphs into Powerpoint for presentation/publcation?

Thanks for the link.  After perusing the page, I tried some code that seemed reasonable to me, but of course it didn't work. See below for the log. I hope you can tell me what's wrong. The details of the proc sgplot are irrelevant, although I'd also be grateful for advice on a simple default setting to do everything black without having to specify every element.

 

Thanks also for the suggestion about getting the graphs picture perfect in SAS to start with.  That would require many hours of struggling with the code, and I still wouldn't be able to animate the components of the slide (e.g., start with the axes, then wipe from the left consecutively each of several time series).

 

When I tried to post this message, I got this error: "Your post has been changed because invalid HTML was found in the message body. The invalid HTML has been removed. Please review the message and submit the message when you are satisfied."  I can't see any changes in the message. 

 

Will

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
56
57 ods html close;
58 ods powerpoint file="D:\Will's Documents\Projects\_NIH\Paul Solberg\IAAF study\slide.ppt" nogtitle;
59 run;
60
61 title3 "and number of deltas>10";
62 title4 "Plot of means and SDs";
63 ods graphics / reset imagemap;
64 proc sgplot data=WORK.DELTALNPERF1 uniform=all noautolegend;
65 scatter x=Age y=DeltaMean / transparency=0.0 name='Scatter' filledoutlinedmarkers
66 markerattrs=(symbol=circlefilled size=10 color=black)
67 markerfillattrs=(color=black)
68 yerrorupper=DeltaMeanPlusSD yerrorlower=DeltaMeanMinusSD
69 errorbarattrs=(color=black);
70 xaxis grid;
71 yaxis grid;
72 refline 0;
73 reg x=Age y=DeltaMean / nomarkers lineattrs=(color=black thickness=1);
74 by event sex;
75 where NoOfDeltas>10;
76 run;
 
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.90 seconds
cpu time 0.51 seconds
 
NOTE: There were 30 observations read from the data set WORK.DELTALNPERF1.
WHERE NoOfDeltas>10;
 
77 ods graphics / reset;
78 ods powerpoint close;
ERROR: Insufficient authorization to access /opt/sasinside/SASConfig/Lev1/SASApp/D:\Will's Documents\Projects\_NIH\Paul
Solberg\IAAF study\slide.ppt.
79 ods html;
NOTE: Writing HTML Body file: sashtml69.htm
ERROR: Insufficient authorization to access /opt/sasinside/SASConfig/Lev1/SASApp/sashtml69.htm.
ERROR: No body file. HTML output will not be created.
80 run;
81
82
83 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
95
Super User
Posts: 17,775

Re: Best way to get graphs into Powerpoint for presentation/publcation?

The error helps...

ERROR: Insufficient authorization to access /opt/sasinside/SASConfig/Lev1/SASApp/D:\Will's Documents\Projects\_NIH\Paul
Solberg\IAAF study\slide.ppt.

 

You've specified your output file incorrectly. Use whatever method you did for RTF file, it's the same process to create a file. 

Contributor
Posts: 64

Re: Best way to get graphs into Powerpoint for presentation/publcation?

Sorry, that was stupid of me not to get the right directory structure to output the file. I forgot to include the usual  "/folders/myshortcuts/" in front of the destination.

 

So I managed to send the graph directly to a powerpoint file, thank you, but unfortunately the resulting graph is a picture of some sort, not an editable vector graphic.

 

Does anyone have an elegant solution to getting editable graphs into Powerpoint (or other vector-graphics editor), or am I stuck with saving as an RTF and copying as a metafile? This question is surely important for most researchers?  I have not had to bother in my previous 30+ years of work with SAS, because I always pasted data from SAS listings into Excel or other graphing package and went from there into Powerpoint (or I gor my students to do it). Now, however, I am promoting SAS Studio with all my colleagues and students, and they can now expect to become independent SAS users, so I feel obliged to provide them with a more efficient graphing solution.

 

Will

Super User
Posts: 17,775

Re: Best way to get graphs into Powerpoint for presentation/publcation?

I think one of the image types should work for you. 

See the various options available for each destination. 

https://support.sas.com/documentation/cdl/en/grstatproc/69716/HTML/default/viewer.htm#p0kroq43yu0lsp...

 

To be frank, teaching anyone to edit a graph manually seems a waste of time. Like I mentioned above, using SGPLOT, SGTemplate and templates in general, you can customize your graphs for publication quality. It's not as 'easy' but the majority of sciences and research nowadays does require some level of proficiency with programming.  

Contributor
Posts: 64

Re: Best way to get graphs into Powerpoint for presentation/publcation?

Reezam, thanks for your continued help with my problem, and I apologize for not making the most of SAS graphics over the years. I gave up with gplot years ago when confronted with the necessary complexity of the code, my students and colleagues had absolutely no chance of learning SAS before SAS Studio came along, and it gave them a sense of involvement and ownership of the results when I fired text output at them to turn into graphs.. Anyway, when I have a spare week or two I will see if I can work out the code to produce a Powerpoint slide that would successively wipe in from the left first the axes and then each of several time series.

 

Meantime...

ods graphics / reset imagemap outputfmt=emf;

...produced a graph in Powerpoint that, when I ungrouped it, turned into a blank square.  Furthe ungroupings and/or deletions did not lead to recovery of the graph.

 

I also got these warnings...

WARNING: html5 destination does not support EMF images. Using the default static format.
WARNING: PDF destination does not support EMF images. Using the default static format.

...even though I had issued ods html close; ods pdf close;  No doubt the syntax of these commands is incorrect, although it shouldn't be.

 

Will

Super User
Posts: 17,775

Re: Best way to get graphs into Powerpoint for presentation/publcation?

Create multiple graphs, one with just axes, then one with each of your time series progressively, ie slide with 1, slide with 2, etc..

It won't have the slide in from the left effect that you want, but each time series will appear next on graph. 

 

Contributor
Posts: 64

Re: Best way to get graphs into Powerpoint for presentation/publcation?

Hi again, guys.  This problem was only partially resolved. The suggestion by Reeza to build the graphic in stages was a good one.  However, as I messaged earlier, I was eventually able to output a graph directly to a Powerpoint file, but when I ungrouped it (to edit it), it disappeared.  I also got some warnings that indicate some issues with background graphics ods options.  Can anyone using Studio/University Edition tell me the ods commands that will generate an editable vector graphic in Powerpoint?  Thanks.  I'm in a Windows 7 environment.

 

Will

Super User
Posts: 17,775

Re: Best way to get graphs into Powerpoint for presentation/publcation?

What version of Powerpoint?

Contributor
Posts: 64

Re: Best way to get graphs into Powerpoint for presentation/publcation?

Office 2010.

##- Please type your reply above this line. Simple formatting, no
attachments. -##
Super User
Posts: 17,775

Re: Best way to get graphs into Powerpoint for presentation/publcation?

Unfortunately I can't test your issues, as I'm using SAS Studio on a Mac and I can't even get the graph to ungroup in Word Smiley Sad

 

I might suggest reposting this question under ODS GRAPHICS forum and/or contacting SAS Tech Support directly. 

Contributor
Posts: 64

Re: Best way to get graphs into Powerpoint for presentation/publcation?

Thanks for the suggestion about posting to the ODS GRAPHICS forum.  I went to the SAS Communities pages but was unable to find such a forum.  Most of the time I wasn't even sure what I was looking at. Sorry.

Super User
Posts: 17,775

Re: Best way to get graphs into Powerpoint for presentation/publcation?

I've moved this question into the forum, but you can post a new question if you'd like as well. 

The link is below as well:

 

https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/bd-p/sas_graph

Super User
Posts: 9,671

Re: Best way to get graphs into Powerpoint for presentation/publcation?

If I was right, you are using University Edition.
Change the path into SHARE path, of course, you need set it up before starting UE.

 ods powerpoint file="D:\Will's Documents\Projects\_NIH\Paul Solberg\IAAF study\slide.ppt" nogtitle;

--->>

 ods powerpoint file="/folders/myfolders/slide.ppt" nogtitle;

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 16 replies
  • 442 views
  • 0 likes
  • 3 in conversation