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

I need to remove the light gray border around the graph in the output PDF. It seems to change based on the style attribute borderwidth in the ods region statement, but I can't find a way to remove it entirely. 

 

proc template;
define style Styles.Custom;
parent = Styles.default; 
class GraphAxisLines/color=black;
class GraphBackground/color=white;
end;
run;

ods _all_ close;
options nonumber nodate orientation=landscape papersize=letter nocenter
	leftmargin=.5in rightmargin=.5in topmargin=.5in bottommargin=.5in;
ods pdf file="E:/SAS figures/fig1_pdf.pdf" dpi=300 notoc;
ods layout absolute description='Primary substance use at admission, 2007-2017';
ods noptitle;
ods pdf style=Custom;]
ods region x=0in y=0in width=10in style=[borderwidth=1 bordercolor=white];
ods graphics on/noborder height=7.5in width=10in scale=on;
title;

proc sgplot data=prim_sub_use noborder nowall;
series x=Year y=Alcohol/markers markerattrs=(symbol=CircleFilled color='#0060A9' size=12) lineattrs=(color='#0060A9' thickness=3);
series x=Year y=Opiates/markers markerattrs=(symbol=TriangleDownFilled size=12 color='#ed1c24') lineattrs=(color='#ed1c24' thickness=3 pattern=solid);
series x=Year y=Cocaine/markers markerattrs=(symbol=SquareFilled color='#ffc222' size=12) lineattrs=(color='#ffc222' thickness=3 pattern=solid);
series x=Year y=Marijuana/markers markerattrs=(symbol=DiamondFilled color='#64c069' size=12) lineattrs=(color='#64c069' thickness=3 pattern=solid) legendlabel="Marijuana/hashish";
series x=Year y=Methamphetamine_amphetamines/markers markerattrs=(symbol=TriangleFilled size=12 color='#00a2e5') lineattrs=(color='#00a2e5' thickness=3 pattern=solid);
yaxis label='Percent of all admissions aged 12 years and older' VALUES = (0 TO 50 BY 10) offsetmax=0 offsetmin=0 valueattrs=(family=Arial size=8);
xaxis label='Admission Year' VALUES = (2007 TO 2017 BY 1) display=(nolabel noticks) valueattrs=(family=Arial size=8);
keylegend/noborder linelength=30 fillaspect=golden valueattrs=(family=Arial size=8);
run;

ods graphics off;
ods layout end;
ods pdf close;
ods _ALL_ CLOSE;

 

1 ACCEPTED SOLUTION

Accepted Solutions
ghosh
Barite | Level 11

Try without the Proc Template?

View solution in original post

7 REPLIES 7
ghosh
Barite | Level 11

Hi 

When I ran this code that I gave you last week I did not get the border on my side (running SODA) , perhaps you have an older SAS?   

 

Perhaps try this:

https://support.sas.com/kb/48/138.html

martyvd
Fluorite | Level 6
I am using SAS 9.4. I tried the code from the link and the line is still visible.
martyvd
Fluorite | Level 6
I did not output as html though as I need a PDF.
ghosh
Barite | Level 11

I am also talikng about pdf, see att directly from the last week's code

 

Can you tell me which version you are running (on SODA it's 9.4m6)  

proc setinit; run;
ghosh
Barite | Level 11

could you try this, replace the ods layout absolute line with the following:

/* ods layout absolute; */
ods layout start style={bordercolor=white borderstyle=solid borderwidth=1pt};
martyvd
Fluorite | Level 6
There is still an extremely faint border when using that code.

Current version: 9.04.01M6P110718
ghosh
Barite | Level 11

Try without the Proc Template?

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