| 1 | <html><h1>quarters</h1><img src="quarters.gif"><p> |
| 2 | <a href="gall.using.html">How to download and try this example</a><br> |
| 3 | |
| 4 | <pre><b>Usage: pl -gif quarters.htm |
| 5 | |
| 6 | In order to use date quarters notation, the X range must be specified |
| 7 | with scaletype date using a month-day-year notation such as mmddyy; |
| 8 | then before plotting bars, switch to X scaletype date nqyy (or some other |
| 9 | quarters notation) using proc defineunits. |
| 10 | |
| 11 | It must be done this way because internally dates in quarters notation |
| 12 | are converted to a midpoint mmddyy, e.g. 1Q99 -> 2/15/99 and |
| 13 | 3Q99 -> 8/15/99. This is done for plotting and date arithmetic purposes. |
| 14 | |
| 15 | Kind of tricky I realize.. it is touched on in the pl dates man page. |
| 16 | |
| 17 | <hr></b> |
| 18 | |
| 19 | // <b> do areadef with X scaled in years, using <a href="../doc/areadef.html">proc areadef</a></b> |
| 20 | #proc areadef |
| 21 | title: Average dividend yield,\nby quarter |
| 22 | rectangle: 1 1 4 2.5 |
| 23 | xscaletype: date mmddyy |
| 24 | xrange: 010198 123101 |
| 25 | yrange: 3.0 6.0 |
| 26 | |
| 27 | // <b> do year X axis using <a href="../doc/axis.html">proc xaxis</a></b> |
| 28 | #proc xaxis |
| 29 | stubs: inc 1 year |
| 30 | stubformat: yyyy |
| 31 | ticlen: 0 0.2 |
| 32 | location: min-0.18 |
| 33 | axisline: none |
| 34 | stubslide: 180(s) |
| 35 | |
| 36 | // <b> do another X axis to show quarters, using <a href="../doc/axis.html">proc xaxis</a></b> |
| 37 | #proc xaxis |
| 38 | stubs: inc 3 month |
| 39 | stubformat: Q |
| 40 | tics: none |
| 41 | stubdetails: adjust=0,+0.05 |
| 42 | stubslide: 45(s) |
| 43 | |
| 44 | // <b> do a Y axis using <a href="../doc/axis.html">proc yaxis</a></b> |
| 45 | #proc yaxis |
| 46 | stubs: inc 0.5 |
| 47 | grid: color=blue |
| 48 | stubformat: %3.1f%% |
| 49 | |
| 50 | // <b>switch to nqyy notation... </b> |
| 51 | #call $changeunits( x, "date nqyy" ) |
| 52 | |
| 53 | // <b> specify data using <a href="../doc/getdata.html">proc getdata</a></b> |
| 54 | #proc getdata |
| 55 | data: 1Q98 5.3 |
| 56 | 2Q98 4.9 |
| 57 | 3Q98 4.7 |
| 58 | 4Q98 4.8 |
| 59 | 1Q99 5.1 |
| 60 | 2Q99 4.8 |
| 61 | 3Q99 5.2 |
| 62 | 4Q99 5.3 |
| 63 | 1Q00 5.5 |
| 64 | 2Q00 5.2 |
| 65 | 3Q00 4.9 |
| 66 | 4Q00 4.9 |
| 67 | 1Q01 4.8 |
| 68 | 2Q01 4.9 |
| 69 | |
| 70 | // <b> render bars using <a href="../doc/bars.html">proc bars</a></b> |
| 71 | #proc bars |
| 72 | locfield: 1 |
| 73 | lenfield: 2 |
| 74 | barwidth: 0.1 |
| 75 | color: yelloworange |
| 76 |