Tuesday, February 28, 2006

st: ordering graphs in panels

Hi all --

I am trying to produce a set of histograms; there are 7, altogether

My data is described by year and subject (jail or prison), as follows:

jail (1988) jail (1993) jail (1999) prison (1984) prison (1990) prison(1995) prison(2000)

I'm using the "by" option of the histogram graph to produce seven graphs; jails in the first row (so first a hole, and then three graphs), and prisons in the second.

So far so good. But, I want there to be only one y axis per row. If the axis is on the left, then it doesn't line up across rows (it appears before item 2 in the first row, and item 1 in the second). So I put the axis on the right, which worked fine.

But, my publication (a student law review, so they don't know anything about stata) wants the y-axis on the left. This leaves me two options, neither of which I can make work:

1) somehow get the axis to show up on the top row in the first spot, where the hole is. 2) reverse the order of the graphs, like so:

jail(1999) jail(1993) jail(1988) prison(1984) etc.

I could, of course, do this by assigning a new variable that has the right order, and using the by option to sort on that command. But then the titles of each of my individual graphs (currently "jail, 1988" etc.) are wrong, and I can't figure out how to beat the default on those titles.

So my questions:

1) Is there any way to get the axis to show up lined up with a hole, rather than with the first graph? 2) Is there any way to reverse the order of the graphs 3) If the way to reverse the order of the graphs is by creating a new variable with the right order, is there any way to change the little subtitles that appear over each one -- and to have those little subtitles not be constant (that is, I can make them be something set, but I need them to vary -- is there a way to make the headings something other than the "by" variables?)

Thanks so much for any help.

Margo Schlanger

_____________________ Margo Schlanger Professor of Law Washington University in St. Louis One Brookings Drive Campus Box 1120 St. Louis, MO 63130 (314) 935-8242 mschlanger@wulaw.wustl.edu http://schlanger.wustl.edu * * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/


Links to this post:

Create a Link

<< Home

This page is powered by Blogger. Isn't yours?