Ploticus date processingPloticus can plot dates directly and do date arithmetic. Many details of date processing, including localization of month and weekday names, can be controlled via settings in proc settings or in your config file. There are also a number of functions that deal with dates.
Plottable date notationsThe following date notations are supported for plotting and date arithmetic:
Month, day, and year notations:
Month & year notations
Quarter year notations
Year only notation
Basic unitThe basic date unit is always a day, regardless of which notation is in use. Stub and tic increments may be expressed in months or years, if desired.
Setting date notationAny date value to be plotted or involved in date arithmetic must conform to the current date notation. The default notation is mmddyy. In scripts, the date notation can be set using the xscaletype or yscaletype attributes of proc areadef , using proc settings or by using a config file. You can also set the date format at anytime using something like this in scripts:
Display-only notationsIn addition to the above plottable notations, the following additional notations may be used only for displaying dates (such as with the stubformat attribute, for instance). They may not be used for date plotting or arithmetic.
Full dates for presentation:
Month & year only: mmyy, mmyyyy
Month & day only: mmmdd, mmm/dd, mmm-dd, mmm_dd, mm/dd, mm-dd, mm_dd, dd-mmm, dd/mmm, ddmmm
Year only: 'yy, yyyy
Month only: mmm, mm, m
Day only: dd d
Key to notation codes
m = single character month (use M for capitalized)
mm = numeric month 01-12
mmm = three-character month e.g. jan (use MMM for JAN or Mmm for Jan)
mon = month abbreviation e.g. Jan
month = full month e.g. January
dd = numeric day 01-31
d = numeric day 1-31
yy = numeric year 00-99
yyyy = numeric year 1800-up
w = single character weekday (use W for capitalized)
www = three character weekday (use Www or WWW for capitalized)
n = 1, 2, 3 or 4 (quarter year notations)
q = the letter q or Q (quarter year notations)
_ (underscore) = space
1. It is possible to omit weekends. This is usually done in business- or market-related plots. To omit weekends, set the omitweekends attribute in proc settings or your config file, or using the $setdateparms() function. Note: as of version 2.30 weekend omission is not supported (and gives incorrect results) for dates before julian 0 date (Jan 1 1970).
2. Date values may or may not be required to adhere exactly to the date format. For instance, if the format is mm/dd/yyyy a value such as 03/04/2001 is always legal, but a value such as 3/4/2001 may not be. Apparently spreadsheets often export dates such as the latter. See the strictdatelengths parameter in proc settings and/or your ploticus config file, or using the $setdateparms() function. By default, ploticus operates in lenient mode. Use strict mode to ensure that malformed dates will be detected.
3. Dates use an internal julian date system where 0 = January 1, 1970. Dates as far back as 1754 AD can be handled.
4. Conversion from two-digit dates to four digit dates is achieved using a pivot year- any two digit year less than this value is assumed to be 21st century. The default pivot year is 70. It can be set via proc settings or in your ploticus config file, or using the $setdateparms() function.
5. When three-character months are used, they are always entered and stored as lower case; however the capitalization of the "mmm" can be altered to control the way dates are presented, e.g. Mmm = Jan, MMM = JAN.
6. "Lazy" dates may be used. A lazy date has 00 as the day and/or month portion and is usually used in situations where the day and/or month is unknown or unavailable. When a lazy date is used in date arithmetic the missing month and/or day is converted to 01. By default, lazy dates are not permitted for date arithmetic.
7. When using notations that do not contain a specific day (such as month year, quarter year, or year only) there may be occasions when it is necessary to specify an exact day point (for example to create an annotation). To do this, an alternate full date format may be used. For example, if yyqn notation is being used, full dates may be given in yy/mm/dd format.
data display engine
Copyright Steve Grubb
|Ploticus is hosted at http://ploticus.sourceforge.net|