Hi there, hoping to get some assistance with showing 4 categories along an x-axis of a bar chart (count) when there are only observations for 3 of those categories in the data set. That is, show that the 4th category recorded no observations. At the moment, my code (see below) is such that only the 3 categories (solar=1, 2 or 3) are displaying and not the 4th (solar=0). I've tried using the "nofill" and "allcategories" commands with no luck. Any help is much appreciated! Cheers!
gen solar = 0 if solar_string=="No Investment"
replace solar = 1 if solar_string=="10kW"
replace solar = 2 if solar_string=="20kW"
replace solar = 3 if solar_string=="30kW"
graph bar (count) solar, over(solar_string, sort(solar)) nofill
0 Response to Bar Graph: Show Category on x-axis with Zero Observations
Post a Comment