I ran into a strange problem when making a bar graph. I have a lot of categories over which the graph is plotted, which seems to be causing problems with the spacing of graphs, so they don't line up with labels. Here is a reproducible example using the auto.dta dataset:
Code:
sysuse auto, clear graph bar price, over(foreign) asyvars over(make, sort(price) des label(angle(90))) legend(pos(6) col(4)) ytitle("Price") scale(0.5)
Graph.gph
As you see, the labels under the graphs do not line up. It is unclear which bar belongs to which label. Here's what I've tried to no avail:
- Use hbar instead of bar -- same issue
- Change the scale
- Played around with bargap
0 Response to Irregular gaps between bars on graph bar
Post a Comment