AtXYPlot(3X)

NAME
AtXYPlot -- Plot meta-class for XY plots

SYNOPSIS
#include <X11/At/XYPlot.h>

DESCRIPTION
The AtXYPlot class is a placeholder for some code and resources for XY plot classes that need access to application data. Its main purpose is to provide public functions that applications use to attach data to the plot widgets, as well as support routines for the widget subclasses.

CLASSES
The class pointer is atXYPlotWidgetClass, and the class name is AtXYPlot. It is a subclass of the AtPlot and Object widget classes.

RESOURCES
The AtXYPlot widget inherits all the resources from the AtPlot and Object widget classes. It defines the following new resources:
AtXYPlot Resources
Name | Class | Type | Default
XtNxOffset | XtCXOffset | XtRDouble | 0.0
XtNyOffset | XtCYOffset | XtRDouble | 0.0

XtNxOffset
    Specifies an offset to be added to the data in X direction when displaying the data. The data are not changed.

XtNyOffset
    Specifies an offset to be added to the data in Y direction when displaying the data. The data are not changed.

PUBLIC FUNCTIONS

void AtXYPlotAttachData(spw, xdata, xtype, xstride, ydata, ytype, ystride, start, num);
void AtXYPlotExtendData(spw, num);

	AtXYPlotWidget spw;
	XtPointer xdata, ydata;
	AtDataType xtype, ytype;
	Cardinal xstride, ystride, start, num;

Most subclasses of AtXYPlot provide #define'd aliases for these routines.

AtXYPlotAttachData()
    This routine is used to attach application data to the subclass plot widget. The widget expects num data items in an array, with xstride bytes between the x values, and ystride bytes between the y values. Xdata points to the first x item in that array, ydata points to the first y item in that array, Each item is of the type described in xtype and ytype, an enumerated type. Currently, only float, double and int are supported, but that is easily extended. All values are converted to doubles by the atXYPlot routines, so the rest of the widget set works in doubles only. The data in the array pointed to by xdata and ydata should remain valid and unchanged as it may be accessed any time should PostScript output be generated or should the parent AtPlotter widget resize or change internal layout. If the application data changes, a new call to AtXYPlotAttachData must be made (even with the same parameters) so that a new bounding box will be calculated and the axis scales readjusted if necessary.

AtXYPlotDataExtended()
    This changes the number of datapoints in the array to num. The existing elements of the array should not have changed. If some extra data has been added to the end of the valid data (for instance because the data represents a time series and the next collection point has just occurred), then this routine will plot the extra data on the existing graph with the minimum possible recalculation and redisplay. Should this not be possible, (because the new data exceeds existing axis bounds in either X or Y axes) then the effect is the same as the equivalent call to AtXYPlotAttachData().

PLOTTER ROUTINES
The following routines are mainly intended for use by subclasses of AtXYPlot, but applications may find it useful. They may be implemented as a macro in some environments.

double AtXYPlotGetXValue(p, i)
double AtXYPlotGetYValue(p, i)
	AtXYPlotWidget p;
	Cardinal i;

Get the ith x or y data item for the AtXYPlot widget, as defined by the latest call to AtXYPlotAttachData().

USAGE
The AtXYPlot widget should not be instantiated. Instead, use one of the subclasses.

SEE ALSO
AtPlotter(3X), AtPlot(3X), AtXYLinePlot(3X)
``Using The AthenaTools Plotter Widget Set''

AUTHORS
Peter Klingebiel, University of Paderborn, using some code from the AtSPlot class.

COPYRIGHT
Copyright 1992 by University of Paderborn All rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the firms, institutes or employers of the authors not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE AUTHORS AND THEIR FIRMS, INSTITUTES OR EMPLOYERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHORS AND THEIR FIRMS, INSTITUTES OR EMPLOYERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.