Dual-line date and probability scales for ZedGraph We have created a new DateDualScale which labels a time axis and a ProbabilityScale which labels a probability axis. Both of these aim to meet the US Geological Survey's graphing standards.

These are each entirely new files (DateDualScale.cs and ProbabilityScale.cs) which need to be added to the ZedGraph project alongside existing classes such as DateScale.cs. A few very small changes are needed to existing ZedGraph classes. The changed versions of Scale.cs, Types.cs, and XDate.cs are included in the zip file linked to above. ZedGraphControl.ContextMenu.cs was also modified for other purposes (adding SaveIn to save the current image to a raster or metafile typed by extension, and fixing saving to a metafile) and is also included.

The DateDualScale labels a horizontal time axis with one or two rows of labels, depending on the date range displayed.

A label for a year, month, or day is centered under the portion of the graph which falls within that year, month, or day (between ticks). Time of day labels are centered under the instant that is labeled (on ticks).

When only one row of labels is used, the MajorGrid and MajorTic are used. When two rows are used, Minor and Major are each used as expected.

The probability scale is different from any other kind of scale I have seen. If you need a probability scale, I hope you understand it well enough to use it. A sample of VB.Net code is provided to show the use of the probability axis.

Open issues:

Choosing Date/Time Units to Label

The decision of which time units to label is based only on the number of days. (Which labels actually fit is also taken into account as labels are drawn.) The decision might be better made in PickScale. PickScale has not been modified for the new labeling and is not currently helpful.

It might be nice to base the decision of which labels to show on measurements of time to display vs. width available (Example: Can all the month names fit?) rather than just on how long a span of time is to be shown.

Probability Labeling

We plan to label the probability axis in more different ways. These are often labeled with return periods (a.k.a. recurrence intervals) instead of or in addition to percent chance. For example, 10% chance = 10 year return period, 2% = 50 year, 1% = 100 year. We also may want to add support for computing either exceedance or non-exceedance curves from a given set of data rather than requiring the user to provide all the percentile values.

Zooming/Panning on Probability Scale

Panning (not zooming) with the mouse already works a bit, but it can lead to strange graph drawing problems and the only way to return to the full range of probabilities is using the context menu to undo the pan operation or set back to defaults. It would be nice if panning and zooming worked better. Allowing the user to change the number of standard deviations displayed would also be a nice addition.