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.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1922 views
  • 0 likes
  • 2 in conversation