#set TITLE = "Gallery - Scaling and axes examples"
#include top

.ig >>
<p>
<b>Ploticus</b> includes an array of options for
defining aspects such as the plot area and the creation of axes.  
Data scaling options include simple linear, log, date, time, datetime, 
and categories.
<p>

<h1><br><br>Basics</h1>
<a href="sa1.htm">sa1<br><img src="sa1.gif"></a>
<br>
<b>Area definition</b>
<br>
Before plotting data, a scaled area must be defined.
<a href="../doc/areadef.html">proc areadef</a> is used to set up a plotting
area, and to define its size, scaling, and location on the "page".
<p>
<b>Axes</b>
<br>
Next, <a href="../doc/axis.html">proc axis</a> 
is invoked to render the X (horizontal), and Y (vertical) axes.  
A typical axis is a line with some number of regularly placed
marks called <b>tics</b>, each of which has a label called a <b>stub</b>.
The axis often has a descriptive text <b>label</b> nearby.
In this example, text stubs appear in the X axis.
The X axis range is from 0 to 5, to allow room for the four stubs, 
which are placed at consecutive locations, as are the bars.
The Y axis is linear numeric with incremental stubs every 20 units; 
there are also "minor tics" along the Y axis, at every 2 units.



<h1><br><br>Simple linear scaling with regular stubs</h1>
<a href="axis1.htm"><img src="axis1.gif"></a>
<br>
Generated incremetally (numeric).
The min, max, and stub increment may be 
<a href="../doc/autorange.html">automatically determined</a>
or specified manually.
<p>
<a href="axis1a.htm"><img src="axis1a.gif"></a>
<br>
Specified literally (alphanumeric).
Literal stubs may be specified in one of these ways:
<li><a href="axis2.htm">given in the script on multiple lines</a>
<li><a href="axis1a.htm">given in the script as a list</a>
<li><a href="axis3.htm">taken from a data field</a>
<li><a href="axis4.htm">taken from an external file</a>
<br>
(By default literal stubs begin at X=1
or Y=1, rather than at 0, since this is usually the desired result,
for bar placement, etc.  This may be overridden using stubrange: 0)


<h1><br><br>Self-locating stubs</h1>
<a href="axis6.htm"<br><img src="axis6.gif"></a>
"Self-locating stubs" are stubs that contain their own location 
By using these, stubs and tics may be placed at 
irregular locations.  
The underlying scale type is usually simple linear,
but it can be any type.
Self-locating stubs may be...
<li><a href="axis6.htm">given in the script on multiple lines</a>
<li><a href="axis7.htm">taken from a data field</a>
<li><a href="axis8.htm">taken from an external file</a>
<br>Other examples:
<li><a href="lineplot3.htm">lineplot3</a>
<li><a href="hbars4.htm">hbars4</a>


<h1><br><br>Log scaling</h1>
<a href="sa3.htm"<br><img src="sa3.gif"></a>
<a href="loglog.htm"<br><img src="loglog.gif"></a>
<br>
Examples of logarithmic scaling.

<h1><br><br>Scale by category</h1>
<a href="sa15.htm"><img src="sa15.gif"></a>
<br>
The <b>categories</b> scale type allows non-numeric tags to be plotted
directly.  This scale type may be useful when rendering scatterplots, 
and bar displays (for bar placement), etc.
<b>Categories</b> do not <b>have</b> to be used in order to make text stubs;
often stubs, bars, etc. are placed sequentially, i.e. "as they fall", with 
the underlying scale type being simple linear numeric, and this is often 
satisfactory.
However, the use of <b>categories</b> as the scale type ensures that
data are being displayed at the correct location.
<br>
More examples:
<li><a href="timely.htm">timely</a>
<li><a href="timeline1.htm">timeline1</a>
<li><a href="timeline2.htm">timeline2</a>
<li><a href="timeline3.htm">timeline3</a>
<p>
A variation of categories scaling is <b>pltab</b> scaling.  This may be
used with the pltab program; the row stubs are automatically taken as 
categories in Y.
<p>
A further extension to the above is <b>pltab_row</b> scaling, where row stubs
serve as an anchor to a mini Y axis with its own scaling.  An example of
this is <a href="../tabgallery/caselist.html">caselist</a>.

<h1><br><br>Date scaling</h1>
<a href="sa5.htm"><img src="sa5.gif"></a>
<p>
<a href="sa5a.htm"><img src="sa5a.gif"></a>
<p>
<a href="sa6.htm"><img src="sa6.gif"></a>
<p>
<a href="sa4.htm"><img src="sa4.gif"></a>
<p>
<a href="sa7.htm"><img src="sa7.gif"></a>
<p>
<a href="sa8.htm"><img src="sa8.gif"></a>
<p>
<a href="sa8a.htm"><img src="sa8a.gif"></a>
<br>
The <b>date</b> scale type allows date values to be plotted directly.
Like other time measures, dates are almost always plotted against the
X axis.  A wide variety of <a href="../doc/dates.html">date notations</a> are supported.
<br>
More examples: 
<li><a href="lineplot4.htm">lineplot4</a>
<li><a href="timeline2.htm">timeline2</a>
<li><a href="sa4a.htm">sa4a</a> (same as sa4 except for year tics)
<li><a href="quarters.htm">year divided into quarters</a> 


<h1><br><br>Time scaling</h1>
<a href="sa10.htm"><img src="sa10.gif"></a>
<p>
<a href="sa11.htm"><img src="sa11.gif"></a>
<br>
The <b>time</b> scale type allows time values to be plotted directly.
A variety of different <a href="../doc/times.html">time notations</a> are supported.
<br>
More examples:
<li><a href="timeline3.htm">timeline3</a>


<h1><br><br>Datetime scaling</h1>
The <b>datetime</b> scale type allows time values to be plotted directly
across multiple days.
A datetime datafield consists of a date value and a time value connected
by a dot (.).  The date and time values may be in any of the supported
plotting formats.
<br>
<a href="hitcount.htm">hitcount<br><img src="hitcount.gif"></a>
<p>
Another example:
<li><a href="hitcount2.htm">hitcount2</a> has time increments along x axis
<br><br><br><h1>Datetime scaling, with time windowing</h1>
Sometimes it is desirable to show only portions of each day, when showing
the entire 24 hour day would be too much.  Examples of this include a work 
day or a trading day.  <b>datetime</b> scaling allows you to do this-
you can indicate the time range for each day at the end of the <b>datetime</b>
keyword.  For example, <tt>datetime9-17</tt> would show only the hours
from 9:00 to 17:00 for each day.  See <a href="../doc/scaleunits.html">scaleunits</a>
for more details on using datetime with time windowing.
<p>
Example:
<li><a href="hitcount3.htm">hitcount3</a> demonstrates time windowing

<h1><br><br>Other axes rendering capabilities</h1>

<h3><br>Multiple areas per "page"</h3>
<a href="sa2.htm">sa2<br><img src="sa2.gif"></a>
<br>
Any number of plotting areas may be rendered on a page.
(more of an issue when rendering onto paper).  Each has its
own <b>proc areadef</b>.  


<h3><br><br>Broken axes</h3>
Broken axis plots, where an axis is broken to allow compact
display of extreme value(s), may be done.
(It requires 
manual "tweaking" and cannot really be automated.)
See the example <a href="brokenaxis.htm">brokenaxis</a>.


<h3><br><br>Axes in unusual places</h3>
<a href="sa12.htm"><img src="sa12.gif"></a><br>
Although Y axis is usually done on the left, and X axis
along the bottom, axes can be placed anywhere.


<h3><br><br>Overlay of multiple scales</h3>
<a href="sa13.htm"><img src="sa13.gif"></a><br>
Two or more coordinate systems may be overlaid, using multiple
#proc areadef invocations that plot into the same rectangle.


<h3><br><br>Overlay of multiple axes</h3>
<a href="sa14.htm"><img src="sa14.gif"></a><br>
This example has two X axes overlaid, in order to do two different
systems of grid lines.  Try this strategy if you have more complicated
requirements for tics, stubs, or grid lines.

.>>

#include bottom
