Plot2D Object Metaclass


Overview

Plot2D is the base class for all the 2D plot objects that can be created by a Chart object. This class is a metaclass and it will never be instantiated. Its only purpose is to define the set of resources common to all 2D plot objects.

Inherited Behavior and Resources

The Plot2D object class inherits behavior and resources from the Xt Object, Graphic and Group.

The following resources are defined by the Plot2D object class:
NameTypeDefaultAccess
XmNdrawFrameBooleanTrueCSG
XmNpropagateBooleanFalseCSG
XmNxAutoRangeModeintXintROUND_MIN_MAXCSG
XmNxAxisPlacementintXintPLACEMENT_BOTTOMCSG
XmNxIncrementsXintIncrements *NULLCSG
XmNxInsidePlacementfloat *NULLCSG
XmNxLimitsXintLimits *NULLCSG
XmNyAutoRangeModeintXintROUND_MIN_MAXCSG
XmNyAxisPlacementintXintPLACEMENT_LEFTCSG
XmNyIncrementsXintIncrements *NULLCSG
XmNyInsidePlacementfloat *NULLCSG
XmNyLimitsXintLimits *NULLCSG


XmNdrawFrame

Specifies whether or not to draw a frame around the plot area. The thickness of the frame is set to be the maximum of the horizontal and vertical thickness. The frame color is set to the color of the axis, horizontal or vertical, that was last set.

XmNpropagate

Specifies whether or not to propagate the resources set in a call to XtSetValues to the Plot2D's sub-objects (series object). This resource is particularly useful to propagate resources controlling the edit mode such as XmNsensitive, XmNmove or XmNshape. For example, to disable editing on all the series objects created inside a plot, apply resources XmNpropagate (set to True) and XmNshape (set to False) for the Plot object. Resource XmNpropagate is reset to False automatically after being used.

XmNxAutoRangeMode

When resource XmNxLimits is NULL, the auto range is activated for the horizontal axis. When auto range is active, the limits of the axis are calculated automatically based on the data range in the axis direction. Resource XmNxAutoRangeMode specifies how those limits are calculated. You can specify one of the following constants:

ConstantDescription
XintROUND_MIN_MAX (default)Axis end values are obtained by rounding off min and max data values to multiples of the major increment.
XintUSE_MIN_MAXAxis end values are set to the min and max data values.


XmNxAxisPlacement

Specifies where to locate the X axis. You can use one of the following constants:

Resource ValueDescription
XintPLACEMENT_TOPAxis is placed at the top of the plot area.
XintPLACEMENT_BOTTOM (default)Axis is placed at the bottom of the plot area.
XintPLACEMENT_NONENo axis is displayed.
XintPLACEMENT_TOP_BOTTOMAxis is placed both at the top and bottom of the plot area.
XintPLACEMENT_INSIDEAxis is placed inside the plot area at Y location specified by resource XmNxInsidePlacement


XmN[xy]Increments

Specifies the major and minor increment for the axis (horizontal or vertical) associated with the Plot2D object. If you don't specify this resource, the axis major and minor increments are calculated automatically based on the range of the data displayed in the plot.

These resources are specified as a pointer to a data structure of type XintIncrements which takes the following form:

   typedef struct {
                   float major_increment;
                   float minor_increment;
   } XintIncrements;


XmN[xy]InsidePlacement

Specifies the location of the X (Y) axis inside the Plot object if resource XmNxAxisPlacement (XmNyaxisPlacement) is set to XintPLACEMENT_INSIDE. The location should be specified using the coordinate system of the other direction, Y (X).

XmN[xy]Limits

Specifies the limits for the axis (horizontal or vertical) associated with the Plot2D object. If you don't specify these resources, the limits of the horizontal axis and vertical axis associated with a Plot2D are automatically calculated based on the range of the data displayed in the plot. This resource can be used to overwrite the default limits or to zoom in on a portion of the plot. If you only want the auto-range option to apply to the minimum or the maximum but not both, specify constant XintUNDEFINED_FLOAT for the field which you want to to be calculated automatically.

These resources are specified as a pointer to a data structure of type XintLimits which takes the following form:

   typedef struct {
                    float minimum;
                    float maximum;
   } XintLimits;


XmNyAutoRangeMode

When resource XmNyLimits is NULL, the auto range is activated for the vertical axis. When auto range is active, the limits of the axis are calculated automatically based on the data range in the axis direction. Resource XmNyAutoRangeMode specifies how those limits are calculated. You can specify one of the following constants:

ConstantDescription
XintROUND_MIN_MAX (default)Axis end values are obtained by rounding off min and max data values to multiples of the major increment.
XintUSE_MIN_MAXAxis end values are set to the min and max data values.


XmNyAxisPlacement

Specifies where to locate the Y axis. You can use one of the following constants:

ConstantDescription
XintPLACEMENT_LEFT (default)Axis is placed to the left of the plot area.
XintPLACEMENT_RIGHTAxis is placed to the right of the plot area.
XintPLACEMENT_NONENo axis is displayed.
XintPLACEMENT_LEFT_RIGHTAxis is placed both left and right of the plot area.
XintPLACEMENT_INSIDEAxis is placed inside the plot area at X location specified by resource XmNyInsidePlacement.


Graphic Class Inherited Resources

Plot2D inherits behavior and resources from the Graphic class. The set of resources that can be accessed along with the proper defaults is listed below.

Graphic Class
NameTypeDefaultAccess
XmNcolorPixelforegroundCSG
XmNdashListchar *NULLCSG
XmNfillColorPixel"gray"CSG
XmNfillFilenamechar *NULLCSG
XmNfillPixmapPixmapNULLCSG
XmNfillStyleintXintFILL_SOLIDCSG
XmNfontchar *"*Helvetica*-120-*"CSG
XmNhighlightModeintXintHIGHLIGHT_HANDLECSG
XmNlineStyleintXintLINE_NONECSG
XmNlineThicknessint1CSG
XmNmoveBooleanTrueCSG
XmNsensitiveBooleanTrueCSG
XmNshapeBooleanTrueCSG
XmNstippleColorPixelforegroundCSG


Defined Function

The following function is defined for the Plot2D Widget.

Function NameDescription
XintPlotInsertObjectAllows insertion of objects into a plot without the need for an expose.


XintPlotInsertObject

This function allows the insertion of objects into a plot without the need for an expose.

     void XintPlotInsertObject (...)

Objectchart or plot IDChart or Plot ID.
ObjectchildName of the child object to be inserted.