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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

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

1 REPLY 1
Jay54
Meteorite | Level 14

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;

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
  • 1 reply
  • 1273 views
  • 0 likes
  • 2 in conversation