LineGraph

Class for drawing a line graph, i.e. a set of points connected by lines.

Members

Functions

drawLegendSymbol
void drawLegendSymbol(FigureBase fig, PlotRect where)
Undocumented in source. Be warned that the author may not have intended to support it.
drawPlot
void drawPlot(Figure form, double leftMargin, double topMargin, double plotWidth, double plotHeight)
Undocumented in source. Be warned that the author may not have intended to support it.
errorWidth
double errorWidth()

Error bar width, relative to the total width of the plot. Must be between 0 and 1. If it's out of bounds, it will be set to the default of 0.05. If no error bars are to be drawn, this option is ignored.

errorWidth
This errorWidth(double newWidth)

Setter

fixBounds
void fixBounds()
Undocumented in source. Be warned that the author may not have intended to support it.
lineColor
Color lineColor()

The color of the line. The default is black.

lineColor
This lineColor(Color newColor)

Setter

lineWidth
uint lineWidth()

The width of the line. The default is 1.

lineWidth
This lineWidth(uint newWidth)

Setter

pointColor
Color pointColor()

The color of each point on the plot.

pointColor
This pointColor(Color newColor)

Setter.

pointSize
int pointSize()

The size of a point. (Default 20).

pointSize
This pointSize(int newSize)

Setter

pointSymbol
char pointSymbol()

The symbol that should be used to denote a data point. Setting this to ' ' (a space) turns off point symbols and plots the line only. By default the point symbol is a space, so no point symbol is plotted..

pointSymbol
This pointSymbol(char newSymbol)

Setter

scaleX
void scaleX(double scaleFactor)

Scale this object by a factor of scaleFactor in the X direction. This is useful for getting it onto the same scale as another plot.

scaleY
void scaleY(double scaleFactor)

Scale this object by a factor of scaleFactor in the Y direction. * This is useful for getting it onto the same scale as another plot.

shiftX
void shiftX(double shiftBy)

Shift this graph by shiftBy units in the X direction. This is useful for getting it onto the same scale as another plot.

shiftY
void shiftY(double shiftBy)

Shift this graph by shiftBy units in the Y direction. This is useful for getting it onto the same scale as another plot.

Static functions

opCall
LineGraph opCall(R1 x, R2 y)

Factory method for creating a LineGraph. x and y must both be input ranges of the same length, with elements implicitly convertible to doubles. Note that they are copied inside the factory, so changes to the original ranges after calling this factory will not affect the plot.

opCall
LineGraph opCall(R y)

Convenience factory method that produces a LineGraph with a default X axis numbered 1, 2, ..., N, where N is the number of data points, and no error bars. This is mostly useful for quick and dirty plots.

opCall
LineGraph opCall(R1 x, R2 y, R3 lowerErrors, R4 upperErrors)

Create a LineGraph with error bars. lowerErrors and upperErrors must be input ranges with elements implicitly convertible to double for error bars to be shown. Any other value, such as null or 0, will result in no error bars being shown. Therefore, to only show, for example, upper erros, simply pass in null or 0 for the lower errors.

Inherited Members

From Plot

upperLim
double upperLim;
Undocumented in source.
lowerLim
double lowerLim;
Undocumented in source.
leftLim
double leftLim;
Undocumented in source.
rightLim
double rightLim;
Undocumented in source.
_legendText
string _legendText;
Undocumented in source.
resetLimits
void resetLimits(Figure figure)
Undocumented in source. Be warned that the author may not have intended to support it.
measureLegend
PlotSize measureLegend(Font legendFont, FigureBase fig)
Undocumented in source. Be warned that the author may not have intended to support it.
drawLegendSymbol
void drawLegendSymbol(FigureBase fig, PlotRect where)
Undocumented in source.
drawPlot
void drawPlot(Figure , double , double , double , double )
Undocumented in source.
hasLegend
bool hasLegend()

Returns true if this plot type supports legends, otherwise false.

toFigure
Figure toFigure()

Convenience method that instantiates a Figure object with this plot. Useful for creating single-plot figures w/o a lot of boilerplate.

toLabeledFigure
Figure toLabeledFigure()

Instantiates a Figure object with this plot and also places the default axes and tick labeling and title for the plot type, if any, on the Figure. If a plot type has no default labeling, simply forwards to toFigure().

leftMost
double leftMost()

The leftmost point on the plot.

rightMost
double rightMost()

The rightmost point on the plot.

topMost
double topMost()

The topmost point on the plot.

bottomMost
double bottomMost()

The bottommost point on the plot.

legendText
string legendText()
legendText
This legendText(string newText)

Meta