Data visualization with SAS programming

Text on EPS Graph with Larger Font Truncated under University Edition

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

Text on EPS Graph with Larger Font Truncated under University Edition

I'm using the SAS University Edition to help me to write a statistics textbook. If I run the program below under the University Edition, it generates an EPS graph. If you convert the graph to PDF using the Adobe PDF converter, then you can see that the highest value label on the horizontal axis is 150. If you look at the number 150, you will see that the right edge of the zero in the number has been “clipped” off.

 

I've attached a copy of a PDF document that was created by Acrobat from the EPS graph to make it easy to see the problem.

 

I know I can get around this problem by using an XAXIS statement and by setting OFFSETMAX to a suitable value. But that's kludgy and must be done on a graph-by-graph basis, and it makes programs harder for beginners to understand. Is there a way that I can solve this problem globally? In particular, is there another statement that I can add to the PROC TEMPLATE run that gives a little more white space around the graph to accommodate the larger axis labels that I’m using?

 

Interestingly, the problem is also present in the standard output if you add the following statement under the PROC SGPLOT statement:

xaxis valueattrs=(size=14pt);

 

I'm running the latest version of the University Edition under Oracle VM VirtualBox version 5.0.0r101573 under up-to-date Windows 7 Professional.

 

Here’s the program: 

 

/* This program generates an EPS file with a graph on which the
   rightmost character of the rightmost tick label on the horizontal
   axis is partially truncated.  Don Macnaughton */
  
ods graphics / reset outputfmt=eps noborder
       imagename="EPSProblem";

proc template;
   define style listing.Mod;
      parent=styles.listing;
      style GraphFonts FROM _SELF_ /                                                     
         'GraphDataFont'   = ("Arial",14pt)        
         'GraphValueFont'  = ("Arial",14pt)             
         'GraphLabel2Font' = ("Arial",14pt,bold) 
         'GraphLabelFont'  = ("Arial",14pt,bold)  
         'GraphAnnoFont'   = ("Arial",14pt)        
         ;
   end;
run;

ods listing device=eps style=listing.mod
               dpi=300
               file= '/folders/myfolders/list.txt'
               gpath="/folders/myfolders/";

data ONE;
input Var1 @@;
datalines;
46 1 18 15 101 116 67 71 54 79 14 41 83 59 58 34
48 129 98 10 56 132 22 66 83 58  1 17 110 43
;
run;

proc sgplot data=ONE;
   histogram Var1;
   run;
  
ods listing close;
ods graphics / reset;

 

Thanks for your help,

 

Don Macnaughton


Accepted Solutions
Solution
‎09-25-2015 06:23 AM
SAS Super FREQ
Posts: 1,081

Re: Text on EPS Graph with Larger Font Truncated under University Edition

Yes, there is a know problem of some text clipping when using scalable output.  A workaround for your case would be to create a PNG output, or, add a little offset at the end of the axis:

 

proc sgplot data=ONE;
histogram Var1;
xaxis offsetmax=0.05;
run;

View solution in original post


All Replies
Solution
‎09-25-2015 06:23 AM
SAS Super FREQ
Posts: 1,081

Re: Text on EPS Graph with Larger Font Truncated under University Edition

Yes, there is a know problem of some text clipping when using scalable output.  A workaround for your case would be to create a PNG output, or, add a little offset at the end of the axis:

 

proc sgplot data=ONE;
histogram Var1;
xaxis offsetmax=0.05;
run;

☑ This topic is SOLVED.

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

Discussion stats
  • 1 reply
  • 345 views
  • 0 likes
  • 2 in conversation