BookmarkSubscribeRSS Feed
Junyong
Pyrite | Level 9

How can I eliminate the borders in SGPLOT HISTOGRAMs?

ods graphics/reset;
ods listing gpath="!userprofile\desktop\";
data _;
do i=-1,0,1;
do j=1 to 5000;
x=i+rannor(1);
output;
end;
end;
run;
proc sgplot;
styleattrs datacolors=(red blue lime);
histogram x/group=i transparency=0.5;
run;

Here's the outcome.

SGPlot.png

Thanks for your help.

2 REPLIES 2
ballardw
Super User

Which border do you want to remove? The one that goes all around the plot or the box with the axis?

 

The NOBORDER option on the Sgplot statement removes the right and top lines that connect to the axis.

Junyong
Pyrite | Level 9

Sorry for this late response, but I wanted to ask something similar to CBARLINE in PROC UNIVARIATE HISTOGRAM.

data _;
do i=1 to 5000;
x=rannor(1);
output;
end;
run;
proc univariate;
var x;
histogram/cfill=blue cbarline=red;
run;

Here's the outcome.

_.png

Hope this clarifies. Thanks for your help.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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