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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 401 views
  • 0 likes
  • 2 in conversation