Data visualization with SAS programming

Editable .emf files for grouped series plots

Reply
Occasional Contributor
Posts: 17

Editable .emf files for grouped series plots

The statistician on my project would like all of our ODS Graphics generated plots editable so we've switched to using an embedded .emf file in our .rtf outputs.  We've been able to get this to work for most plot types but I am stumped as to why I can't get the below grouped series plot to work.  It seems to be fine if I only generate one of the lines but if I try to generate both on the same plot it does not work.  I've tried both one SERIES statement with /group=treatgroup as well as separate SERIES statements with different Y axis variables.  I've tried the GTL equivalent of this SGPLOT which had the same effect...editable with one line on the plot but not two.  To be clear, it generates both lines from the SERIES statement but the plot is not editable at all.

So my questions:

1.  Is there some known issue with .EMF files that does not allow grouped data?

2.  Is there another way to generate these grouped series plots that I'm not thinking of?  I tried HLINE in an act of desperation but that didn't work either.

I'm running v9.3 and my code is below:

1st attempt:

proc sgplot data=dor2 ;

  xaxis type=linear values=(0 to 20 by 1) label="Time in Months";

  yaxis type=linear values=(0 to .3 by .05) label="Percentage" tickvalueformat=percent12.0;

  series x=x y=pct_trt1;

  series x=x y=pct_trt2;

run;

2nd attempt

proc sgplot data=dor2 ;

  xaxis type=linear values=(0 to 20 by 1) label="Time in Months";

  yaxis type=linear values=(0 to .3 by .05) label="Percentage" tickvalueformat=percent12.0;

  series x=x y=pct/group=trtgroup;

run;

Attachment
Grand Advisor
Posts: 9,699

Re: Editable .emf files for grouped series plots

You don't say how you are trying to edit them, which application. In some WORD documents graphic elements may need to be UNGROUPED to edit individuals. I haven't done this in Office 2007/ 2010, but there may be a menu item after selecting a graph to ungroup the elements.

Anything other than editing labels though seemed to take so much hand work that it was often faster to go back and regenerate graphs than to fiddle with points and lines in Word.

Occasional Contributor
Posts: 17

Re: Editable .emf files for grouped series plots

Thanks for the comments but it's the "ungrouping" that's not working unfortunately.  For all of the other plots we've done we right click in Word, Edit Picture, Ungroup and all elements become editable.  For this particular type of plot I can right click, Edit Picture and am given the option to Ungroup but get a Microsoft warning saying it's an imported image not a group and then nothing is editable.

I agree that it would be easier to make the changes in the SAS directly but the statisticians/medical writers want to be able to make changes for the presentations (eg. color, font, background, etc).  And of course they don't understand why all of the other plots worked and this one doesn't which makes two of us.  :smileyconfused:

Grand Advisor
Posts: 9,699

Re: Editable .emf files for grouped series plots

When I get oddish behaviors like this I start looking very closely at all the graphics and ods graphics options and output statements to see if the differences could be doing this.

My last fun part with Word and graphics was why only the first graph would appear. Had to go poking around Word link settings to fix that one.

Grand Advisor
Posts: 16,304

Re: Editable .emf files for grouped series plots

You could look into SGDesign instead of the SGPlot procedure and give that a try, but I bet somethings not set properly. If you post the code I'll try it on my machine. That graph does look ugly, not coming across well at all. (Try tools>ODS Graphic Designer) The designer will produce SAS code after all the clicks that you can use to automate processes.

Tech Support is probably the best to work with on this though.

Occasional Contributor
Posts: 17

Re: Editable .emf files for grouped series plots

Thanks for the comments everyone.  I finally figured out what was causing my problem.  Evidently the EMF output type did not like the dashed line in my plot.  Once I converted the dashed line to a solid line everything worked perfectly.  I'm not sure if EMF just doesn't support dashed lines or if there's something endemic to our system/graph styles but hopefully this information can help someone in the future. 

Grand Advisor
Posts: 9,699

Re: Editable .emf files for grouped series plots

Here's a thought: dashed line is too many elements trying to handle each dash as separate element instead of a single dashed line, so Word just refuses and replies with a typically not quite on topic Microsoft error message.

Post a Question
Discussion Stats
  • 6 replies
  • 538 views
  • 1 like
  • 3 in conversation