I am trying to plot a bar chart with two bars graphed over consecutive years. While the following may compose a correct plot, however, the labeling are *wrong*. In brief, the goal is to add: x-axis label + the value of bars.
Code:
graph bar executions sentences , over(year, label(angle(forty_five) ))
(On the structure of the data set: observations are yearly, with "executions" and "sentences" being the total number of such action in the year.)
The difficulties I face are:
1. The x-axis is populated with all the years! I tried to manipulate the value labels for the variable "year" but failed to enforce the desirable result. Labeling those years in between (like 1971-1974) as empty string (or " ", a space) does not help eliminate the label on x-axis.
On the other hand, there is not an option through the graphical interface that stipulates how to make those awkward years-in-between vanish. The only available option is to "suppress" the x-axis label, which eliminates everything marking the x-axis.
2. Label the value/magnitude of the one of the two bars. (I would like to put the exact number stored by variable "sentences" on top of the bar.)
Any suggestion on how to solve either one of the above issue?
Thank you in advanced
All the best,
-Linfeng
Code:
graph bar executions sentences , over(year, label(angle(forty_five) ))
(On the structure of the data set: observations are yearly, with "executions" and "sentences" being the total number of such action in the year.)
The difficulties I face are:
1. The x-axis is populated with all the years! I tried to manipulate the value labels for the variable "year" but failed to enforce the desirable result. Labeling those years in between (like 1971-1974) as empty string (or " ", a space) does not help eliminate the label on x-axis.
On the other hand, there is not an option through the graphical interface that stipulates how to make those awkward years-in-between vanish. The only available option is to "suppress" the x-axis label, which eliminates everything marking the x-axis.
2. Label the value/magnitude of the one of the two bars. (I would like to put the exact number stored by variable "sentences" on top of the bar.)
Any suggestion on how to solve either one of the above issue?
Thank you in advanced

All the best,
-Linfeng
Comment