Graph elements

class Graph.TGraphElem


This specifies if the element is shown in the graphing area.


Indicates if the element is shown in the legend.


This is the text string shown in the legend.


This is a read only attribute indicating the parent element when the object is in the function list.


PluginData is a dictionary like object where a plugin can store data local to an element. The data is stored in the .grf file. Graph itself does not use this, it is only for use by plugins Every plugin should use a unique value as key in the PluginData dictionary. The value assigned should be a tuple, which may contain anything that can be passed to xmlrpc, e.g. tuples, lists, strings, numbers.


This is a list of child elements as shown in the function list.


This creates a new copy of the object.

class Graph.TBaseFuncType


This is a list of data points used to plot the function. Each entry is a tuple with 3 elements, the independent variable, x-coordinate and y-coordinate.


This is a list of pixel coordinates used to plot the function.


This is a list of values indicating the number of continues points in each segment.


This specifies the color of the function.


This specifies the width of the function in pixels on the screen.


This specifies the line style of the function.

TBaseFuncType.From, TBaseFuncType.To

From and To specifies the the range of the function. Standard functions may use float("-inf") and float("inf") for an infinite range.

TBaseFuncType.StartPointStyle, TBaseFuncType.EndPointStyle

These indicates the style of the end points. Use 0 if you don't want an endpoint.


This indicates how the functions is plotted. Valid values are Graph.dtAuto, Graph.dtDots and Graph.dtLines.


This method will create and return the first derivative of the function.


This evaluates the function at the specified independent variable t. The result is a tuple if the (x,y) coordinate pair.

TBaseFuncType.CalcArea(From, To)

Calculates the signed area over the range between From and To by numeric integration. The calculated area is between the function and the x-axis for standard and parametric functions, while it is the area between the function and the center for polar functions.

class Graph.TStdFunc

class Graph.TStdFunc(Str)

Creates a standard function from the expression in Str with "x" as the independent variable.


This is the same string as was passed to the constructor.

class Graph.TParFunc

class Graph.TParFunc(xStr, yStr)

Creates a parametric function from the expressions in xStr and yStr where the independent variable is "t".

TParFunc.xText TParFunc.yText

These are the same strings as was passed to the constructor.

class Graph.TPolFunc

class Graph.TPolFunc(Str)

Creates a polar function from the expression in Str where the independent variable is "t".


This is the same string as was passed to the constructor.

class Graph.TTan

class Graph.TTan()

Creates a new tangent or normal. It must be attached to a function to be plotted.


This property is True if the tangent is valid, i.e. the function has a first derivative at t.


This is the value where the tangent/normal interacts with the its parent function.


This indicates if the object is a tangent or normal. Valid values are Graph.ttTangent and Graph.ttNormal.

class Graph.TPointSeries

class Graph.TPointSeries()

Creates a new point series.

TPointSeries.FillColor, TPointSeries.FrameColor, TPointSeries.Size, TPointSeries.Style

These properties sets the color filling the markers, the border color of the markers and the style of the markers.

TPointSeries.LineColor, TPointSeries.LineSize, TPointSeries.LineStyle

These properties sets the color, size and style of the line between the markers.

TPointSeries.xErrorBarType, TPointSeries.yErrorBarType

These specifies the type of vertical and horizontal error bars. Valid values are Graph.ebtNone for no error bars, Graph.ebtFixed for fixed size error bars, Graph.ebtRelative for error bars being a percentage of the coordinate value, and Graph.ebtCustom for a custom specified error bar for every point.

TPointSeries.xErrorValues, TPointSeries.yErrorValues

These contains the value used for the error bars when xErrorBarType or yErrorBarType is Graph.ebtFixed or Graph.ebtRelative.


This specifies the interpolation algorithm used for drawing lines between the markers. Valid values are Graph.iaLinear, Graph.iaCubicSpline, Graph.iaHalfCosine and Graph.iaCubicSpline2.


Set this to True to show coordinate labels next to the markers.


This sets the font used when drawing the coordinate labels.


This specifies where the coordinate labels are placed relative to the markers. Valid values are Graph.lpAbove, Graph.lpBelow, Graph.lpLeft, Graph.lpRight, Graph.lpAboveLeft, Graph.lpAboveRight, Graph.lpBelowLeft and Graph.lpBelowRight.


This specifies if the coordinates in Points are in polar or cartesian coordinates. Valid values are Graph.ptCartesian and Graph.ptPolar.


This is a list of tuples with (x,y) coordinates for the points.


This is a list with a tuple with 4 elements for each point. The tuple contains the first coordinate, second coordinate, x-error and y-error, all in text form. The first and second coordinates are (x,y) coordinates if PointType is Graph.ptCartesian, and (θ,r) coordinates if PointType is Graph.ptpolar.

class Graph.TTextLabel

class Graph.TTextLabel()

Creates a new text label object.


This is the text in the label in Rich Text format.


This is the background color of the label. Use 0x1fffffff for transparent.


This specifies the placement of the label. Valid values are Graph.lpUserTopLeft, Graph.lpAboveX, Graph.lpBelowX, Graph.lpLeftOfY, Graph.lpRightOfY, Graph.lpUserTopRight, Graph.lpUserBottomLeft and Graph.lpUserBottomRight.


This specifies the rotation of the label in degrees.

TTextLabel.xPos, TTextLabel.yPos

xPos and yPos indicates the (x,y) coordinate of the label when Placement is Graph.lpUserTopLeft, Graph.lpUserTopRight, Graph.lpUserBottomLeft or Graph.lpUserBottomRight.

class Graph.TShading

class Graph.TShading()

Creates a new shading object. It must be attached to a function to be plotted.


This specifies the type of shading. Valid values are Graph.ssAbove, Graph.ssBelow, Graph.ssXAxis, Graph.ssYAxis, Graph.ssBetween and Graph.ssInside.


This is a vcl.TBrushStyle that specifies the brush style used to plot the shading.


This specifies the color of the shading.


This must specify the second function when BrushStyle is Graph.ssBetween.

TShading.sMin, TShading.sMax

This is the start and end values on the function for the shading.

TShading.sMin2, TShading.sMax2

When ShadeStyle is Graph.ssBetween this is the start and end value on Func2 for the shading.

TShading.ExtendMinToIntercept, TShading.ExtendMaxToIntercept, TShading.ExtendMin2ToIntercept, TShading.ExtendMax2ToIntercept

When True, sMin and sMin2 are decreased and sMax and sMax2 are increased until the function is crossing the axis, the edge of the graphing area, itself or another graph depending of the value in ShadeStyle.


When True a line will be drawn around the shading.

class Graph.TRelation

class Graph.TRelation(Str, [ConstraintStr])

Creates a new relation object with the relation specified in Str and an optional constraint specified in ConstraintStr.


This is a vcl.TBrushStyle that specifies the brush style used to plot inequalities.


This specifies the color of the relation.


This read only attribute indicates if the relation is an equation (Graph.rtEquation) or inequation (Graph.rtInequality).


This is the width of the plot of the inequation or the width of the borderline around the inequality. Size may be 0 if no borderline is wanted.


This is the text of the equation or inequality.


This is the text of the constraints.

TRelation.Eval(x, y)

Evaluate the relation at the given x- and y-coordinates and return the result.