I am trying to create a simple bar chart to display percent Protein, Fat, and Carbohydrate in a small (n=8) series of small and large meals.
graph bar PRO FAT CHO, over(MealType) creates the graph in the attached image.
But what I am aiming for is the 2 bars for PRO to be next to one another, the the 2 bars for FAT, etc. I suppose I could create a graph for each one and then combine, but is there a more straightforward method?
I think I know how to improve the axis labels, etc. But I can't figure out how to assemble the bars as I wish.
Sorry if the answer is obvious, and appreciate any help!
Tim

graph bar PRO FAT CHO, over(MealType) creates the graph in the attached image.
But what I am aiming for is the 2 bars for PRO to be next to one another, the the 2 bars for FAT, etc. I suppose I could create a graph for each one and then combine, but is there a more straightforward method?
I think I know how to improve the axis labels, etc. But I can't figure out how to assemble the bars as I wish.
Sorry if the answer is obvious, and appreciate any help!
Tim
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(MealType PRO FAT CHO) 0 25.6 28.5 45.9 1 3.3 21.9 74.8 0 14 30.4 55.5 1 11.9 40.5 47.6 0 19.6 33.6 46.8 1 13.9 32.1 54 0 9 25.9 64.1 1 12.3 34.5 53.2 end label values MealType TypeLabel label def TypeLabel 0 "Small", modify label def TypeLabel 1 "Large", modify
Comment