Hello all,
I would like to create a histogram of a 4-level categorical variable (hh_comp) that describes household composition, by level of food security (4-level categorical variable, hh_fsec4).
Code:
hist hh_fsec4 if timepoint ==0, by(hh_comp, graphregion(color(white))) percent addlabels discrete xlabel (1 "High" 2 "Marginal" 3 "Low" 4 "Very low")

This works well, except that the label at the bottom is not helpful and just takes up space. I realize I can fix this in graph editor. However, I will create this graph across multiple timepoints using a loop, and would therefore prefer to automate the process. I tried

Code:
hist hh_fsec4 if timepoint ==0, by(hh_comp, graphregion(color(white))) percent addlabels discrete xlabel (1 "High" 2 "Marginal" 3 "Low" 4 "Very low") legend(order 1 2 3 4)
because of another post on Statalist. However, that was for a scatterplot I believe, and I learned that doesn't work with histograms because Stata informed me that "option order not allowed."

Thank you for any advice!