BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
saibot
Calcite | Level 5

Hi all,

I use the GPLOT procedure with the following options:

PROC GPLOT DATA = d_plot ANNOTATE = anno ;
  PLOT y * x = Line / haxis=axis1
    vaxis=axis2
    nolegend
    autovref
    cautovref= cx505050
    lautovref= 33
    autohref
    cautohref= cx505050
    lautohref= 33
  ;
RUN; QUIT;

With my macro, I create graphs of type .emf or .eps, depending on a macro variable with name TYPE. My goptions are:

%IF ( &TYPE. = emf ) %THEN %DO ;
  goptions ftext = 'arial' device = sasemf gaccess = gsasfile gsfmode = replace
  vsize = 12 cm hsize = 12 cm
  ;
  filename gsasfile "pathname\name.emf";
%END;
%IF ( &TYPE. = eps ) %THEN %DO ;
  ODS LISTING CLOSE ;
  OPTIONS PAPERSIZE = ("12cm","12cm") NODATE NONUMBER ;
  ODS PRINTER printer = "PostScript EPS Color" FILE = pathname\name.emf";
  goptions ftext = 'Helvetica' gsfmode = replace
  hsize = 12 cm vsize = 12 cm
  ;
%END;

The grid creation by the plot options autovref and autohref works fine for the emf-files, but the grid is not visible in the eps-files. Is there any reason why the options are ignored if the eps-files are produced?

Thanks in advance and best regards,
saibot

1 ACCEPTED SOLUTION

Accepted Solutions
GraphGuy
Meteorite | Level 14

I'm not too savvy with emf, but I ran the following which creates a graph using your options to create the reference lines, and then I viewed the output (in Adobe Photoshop Elements 9), and the reference lines were visible.  Note that depending on your zoom level, and the size of the graph, it is possible for light gray dashed lines to "drop out" (ie, become "invisible").

%let name=plt011;
filename odsout '.';

Goptions Reset   = Goptions
  Device  = sasprtc
  Ftext   = 'Arial'
  Hsize   = 7 IN
  Vsize   = 5 IN;
ods printer SAS printer="PostScript EPS Color" file="&name..eps";

proc gplot data=sashelp.class;
plot height*weight /
autovref
cautovref=cx505050
lautovref=33
autohref
cautohref=cx505050
lautohref=33
;
run;
quit;

View solution in original post

4 REPLIES 4
GraphGuy
Meteorite | Level 14

I'm not too savvy with emf, but I ran the following which creates a graph using your options to create the reference lines, and then I viewed the output (in Adobe Photoshop Elements 9), and the reference lines were visible.  Note that depending on your zoom level, and the size of the graph, it is possible for light gray dashed lines to "drop out" (ie, become "invisible").

%let name=plt011;
filename odsout '.';

Goptions Reset   = Goptions
  Device  = sasprtc
  Ftext   = 'Arial'
  Hsize   = 7 IN
  Vsize   = 5 IN;
ods printer SAS printer="PostScript EPS Color" file="&name..eps";

proc gplot data=sashelp.class;
plot height*weight /
autovref
cautovref=cx505050
lautovref=33
autohref
cautohref=cx505050
lautohref=33
;
run;
quit;

saibot
Calcite | Level 5

Thank you very much for your answer. It was right, I changed the color to black and now, the lines are visible. I didn't expect such an optical difference between emf- and eps-graphs.

One further question about your options. You chose

  Device  = sasprtc

I ran my program with this option and without, both worked and gave the same result. If I use the

ODS PRINTER printer="PostScript EPS Color"

statement, is it advantageous/necessary to use additionally the "Device  = sasprtc" option?

Thank you and best regards,

saibot

GraphGuy
Meteorite | Level 14

I'm not sure - in areas like this, I just find something that works and go with it.

saibot
Calcite | Level 5

Smiley Happy That is also my approach to all the device/printer options...

Thank you for your help!

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
  • 4 replies
  • 1778 views
  • 0 likes
  • 2 in conversation