04.06.2013 Views

Introduction to Stata 8 - (GRIPS

Introduction to Stata 8 - (GRIPS

Introduction to Stata 8 - (GRIPS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

You may define maximum and minimum values at the axes:<br />

...<br />

yscale(log range(0.8 150))<br />

If you use the s2color, s2mono or lean2 scheme, the default is horizontal gridlines and<br />

no vertical gridlines. To drop horizontal and include vertical gridlines (hardly a good idea in<br />

this case):<br />

...<br />

xlabel( , grid) ylabel(1 2 5 10 20 50 100 , nogrid)<br />

If you want <strong>to</strong> display decimal commas rather than periods, give the <strong>Stata</strong> command:<br />

set dp comma<br />

Plotregion margin<br />

By default twoway graphs include a margin between the extreme plot values and the axes, <strong>to</strong><br />

avoid symbols <strong>to</strong>uching axes. If you want a zero margin – as in the twoway line plot,<br />

section 14.7 – include:<br />

...<br />

plotregion(margin(zero))<br />

14.5. Placing graph elements<br />

The placement of graph elements, e.g. the legend, is defined by location relative <strong>to</strong> the plot<br />

area (ring position) and a direction (clock position). The placement of elements in Figure 1<br />

was determined by the scheme applied (see section 14.9); the placements were:<br />

Element Ring position<br />

ring()<br />

Clock position<br />

pos()<br />

Position can<br />

be modified<br />

Plot area 0 ... No<br />

Y-axis title 1 9 No<br />

X-axis title 1 6 No<br />

Subtitle 6 12 Yes<br />

Title 7 12 Yes<br />

Legend 3 4 Yes<br />

Note 4 7 Yes<br />

The twoway line plot, section 14.7, illustrates an alternative placement of the legend:<br />

...<br />

legend(label(1 "Males") label(2 "Females") ring(0) pos(8))<br />

A text block is placed in the plot area by giving its y and x coordinates; place(c) (the<br />

default) means that the coordinates apply <strong>to</strong> the center of the text block; place(se) that<br />

they apply <strong>to</strong> the block's southeast corner. See example in Figure 1 and the twoway line<br />

plot, section 14.7:<br />

...<br />

text(90 69 "1999-2000")<br />

41

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!