BookmarkSubscribeRSS Feed
stacey11
Calcite | Level 5

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;

6 REPLIES 6
ballardw
Super User

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.

stacey11
Calcite | Level 5

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:

ballardw
Super User

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.

Reeza
Super User

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.

stacey11
Calcite | Level 5

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. 

ballardw
Super User

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.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 2449 views
  • 1 like
  • 3 in conversation