Me again. I need help with output format using the -grc1leg- command combining 12 histograms into one figure.
Here's part of my code. It's not the entire code as posting that would be far too much and hopefully isn't necessary. There's also some information in the entire code I'd like not to reveal.
Code:
forvalues v = 1/12{ //begin dependent variable loop local xlabel_range : word `v' of "0(1)10" "0(1)10" "0(1)10" "0(1)10" "0(1)10" "0(1)10" "1(1)7" "1(1)7" "1(1)7" "1(1)7" "1(1)7" "1(1)7" twoway histogram hist_var if $sample_restrictions, discrete percent scheme(s1mono) gap(30) title("`title'") xtitle("") ytitle("" /*"Frequency in percent"*/, height(5)) legend(rows(1) label(1 "All first-borns")) color(gs14) ylabel(, labsize(small)) ysize(1.167) /// || histogram hist_var if $sample_restrictions & female==0, discrete percent legend(label(2 "Men")) color(black) recast(line) lwidth(thick) lpattern(dash) xlabel("`xlabel_range'", labsize(small) format(%-1s)) /// || histogram hist_var if $sample_restrictions & female==1, discrete percent legend(label(3 "Women")) color(gs6) recast(line) lwidth(thick) xlabel("`xlabel_range'", labsize(small) format(%-1s)) saving(HIST_`depvar', replace) local histogramcombine "`histogramcombine' HIST_`depvar'.gph" } //end dependent variable loop grc1leg `histogramcombine', l1title("Frequency in percent of the total sample per measure", size(medsmall) ) title("" /*"Distribution of First-borns' Traits"*/) saving(HIST_COMBINED, replace) scheme(s1mono) graphregion(color(white)) cols(2) ysize(7) // alternative -graph combine- shows one legend per plotted graph local histogramcombine "" //empty local for use of next gender loop
Here is what the output roughly looks like (I had to take out some labels and the legend):
Array
Now let me come to my question.
How do I make Stata produce those histograms with a bigger ysize() ?? The way these histograms are cramped is so ugly. It's really hard to interpret any of the histograms. Eventually, all those histograms are supposed to take up one A4 sized sheet (including some notes below).
You can see the bolded ysize() option in the "twoway histogram ...." code above. The ysize() option apparently didn't do the trick.
Why not? Any suggestions please?
Many thanks in advance!
Thomas
0 Response to Format of combined histograms using -grc1leg-
Post a Comment