BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Annie_Fréchette
Obsidian | Level 7
proc sgplot
data=incid_mam;
yaxis label='Proportion of farms (%)' valueattrs=(size=16) labelattrs=(size=16);
xaxis label='Clinical mastits incidence (case/100 cow-year)' valueattrs=(size=16) labelattrs=(size=16);
histogram inc_1_tot_100/group=lfr scale=percent nbins=20 transparency=0.70;
density inc_1_tot_100/ type=kernel group=lfr;
run;

Hi, I'm running this code to create this simple histogram.

Annie_Fréchette_0-1600279066627.png

 

I have two questions:

First, how can I change or remove what I've put in yellow? In my data it's a binary category, but I want to precise it in a presentation of this graph.

 

Also, how can I "cut"  my x axis, let's say at 75.

 

Thanks ,

Annie

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

You can remove the legend with the NOAUTOLEGEND option in the PROC SGPLOT statement.

 

You can use the MIN and MAX option in the XAXIS statement to control the XAXIS (although I'm not sure if it works for HISTOGRAM, you'll just have to try it and find out)

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

You can remove the legend with the NOAUTOLEGEND option in the PROC SGPLOT statement.

 

You can use the MIN and MAX option in the XAXIS statement to control the XAXIS (although I'm not sure if it works for HISTOGRAM, you'll just have to try it and find out)

--
Paige Miller
Annie_Fréchette
Obsidian | Level 7

Hi Paige! Thanks for the quick answer.Both of your answer are working!

 

Thanks

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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