Anybody know if there is a way to get the boxes in a grouped boxplot above eachother instead of grouped? For example I plot salary per state and gender and I want salary on the y-axis and state on the x and one box per gender. On the x-axis i only want the state once, not twice as it is in this plot:
length gender salary 8 state $15;
input gender salary state;
1 10000 Mora
1 15300 Stockholm
1 11500 Sala
1 12300 Gävle
1 11300 Mora
2 16800 Gävle
2 12500 Stockholm
2 13500 Norrköping
2 16200 Norrköping
2 17500 Sala
2 11700 Stockholm
2 17100 Mora
do i = 1 to 100;
salary = salary+(i);
Did you run the code above, with the ods graphics on before the first boxplot? Because,there is no gseg catalog in the work. If you ran it, did it produce a horizontal boxplot and also the last one with greplay? Doesn't work for me.
Can you email me the results, so that I can see? firstname.lastname@example.org
I can't fathom why greplay works fine for vertical boxes and would behave differently for horizontal ones. Greplay just replays graphics, you could be drawing kittens for all it cares. Sorry I can not test with horizontal boxes as I don't have 9.2.
If you get stuck, there other ways, like using the rotate function of greplay's templates (you'll have to manually tweak the axis labels and values), or better yet, using Michael Friendly's powerful macro at http://www.math.yorku.ca/SCS/sssg/boxplot.html.
I have managed to get exactly what I want using proc template and proc sgrender, thanks to some suggestions from SAS guys on here. I can now get overlaid horizontal boxplots as one of the boxplot options in proc template is orient= which specifies the orientation of the y-axis and the boxes so if you set it to horizontal you get hoizontal box plots, and when you set the layout=overlay you get overlaid horizontal boxplots. In proc template there is a whole load of attributes you can set too to change the appareance of the text, data markers, lables colours borders etc. I found it perfect for what I wanted to do.
Jenny, I've been following this thread as I've been trying to achieve something similar to you. I want horizontal boxplots on the same axis for different groups of data. I've been playing with your code and code suggested by Chris and can't get it to work either. I too have no gseg catalogue in Work. I think this is because when we put the proc boxplot statements inside the ODS graphics statements the plots are produced in ODS graphics output and rather than in a graphics catalgue and hence no gseg is produced. But we need to use ODS graphics to get horizontal plots. I haven't found a way round this yet and wondered if you had? of if anyone else has any suggestions we could try?