Data visualization with SAS programming

PLOT options autohref autovref don't work, if eps graph is created with "ODS PRINTER printer="PostScript EPS Color"

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 11
Accepted Solution

PLOT options autohref autovref don't work, if eps graph is created with "ODS PRINTER printer="PostScript EPS Color"

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


Accepted Solutions
Solution
‎11-02-2011 03:36 PM
SAS Employee
Posts: 967

PLOT options autohref autovref don't work, if eps graph is created with "ODS PRINTER printer="PostScript EPS Color"

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


All Replies
Solution
‎11-02-2011 03:36 PM
SAS Employee
Posts: 967

PLOT options autohref autovref don't work, if eps graph is created with "ODS PRINTER printer="PostScript EPS Color"

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;

Occasional Contributor
Posts: 11

Re: PLOT options autohref autovref don't work, if eps graph is created with "ODS PRINTER printer="PostScript EPS Color"

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

SAS Employee
Posts: 967

Re: PLOT options autohref autovref don't work, if eps graph is created with "ODS PRINTER printer="PostScript EPS Color"

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

Occasional Contributor
Posts: 11

Re: PLOT options autohref autovref don't work, if eps graph is created with "ODS PRINTER printer="PostScript EPS Color"

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

Thank you for your help!

☑ This topic is SOLVED.

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

Discussion stats
  • 4 replies
  • 359 views
  • 0 likes
  • 2 in conversation