I am using catplot from SSC in Stata 15.1.
I have survey data. Respondents attended a workshop and indicated how relevant the session was to them and listed their years of work experience:
I am using a stacked bar chart to graph how relevant the session was to attendees by years of work experience. My code is:
This code gives me the graph I want, but as seen below, the legend labels overlap:

This problem curiously did not arise until I used the blabel option to include percentages on the graph. Thanks for reading.
I have survey data. Respondents attended a workshop and indicated how relevant the session was to them and listed their years of work experience:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long(relevance experience) 5 4 5 1 5 1 5 6 4 2 4 5 4 4 5 1 5 2 4 4 4 5 5 1 5 1 5 5 4 5 4 1 5 4 5 1 4 2 5 4 5 6 5 1 5 5 5 3 5 6 5 1 4 6 5 3 5 4 5 1 4 1 5 1 5 6 4 2 5 1 5 1 5 2 4 5 5 2 5 2 5 1 5 6 4 3 4 5 3 1 4 5 4 1 1 6 5 5 5 1 5 1 5 1 5 1 5 1 5 1 5 2 4 5 5 2 4 1 4 1 5 1 5 1 5 5 5 1 5 2 5 3 5 3 4 6 5 1 5 1 5 4 5 5 5 5 4 4 5 2 5 3 5 2 4 3 5 1 5 1 4 5 5 3 5 4 5 3 4 4 4 2 4 6 5 2 3 5 5 2 5 4 5 2 4 1 5 3 4 4 5 3 1 2 5 1 5 1 5 1 end label values relevance relevance label def relevance 1 "Unsure", modify label def relevance 3 "Not really relevant", modify label def relevance 4 "Somewhat relevant", modify label def relevance 5 "Very relevant", modify label values experience experience label def experience 1 "25+", modify label def experience 2 "21-25", modify label def experience 3 "16-20", modify label def experience 4 "11-15", modify label def experience 5 "6-10", modify label def experience 6 "<5", modify
Code:
catplot relevance experience, percent(experience) asyvars stack title("How Relevant was the Session?") /// subtitle(by years of work experience) blabel(bar, pos(center) format(%2.0f)) legend(pos(bottom) col(5))
This problem curiously did not arise until I used the blabel option to include percentages on the graph. Thanks for reading.
Comment