Figure

A container form for one or more Plot objects.

Members

Functions

addLines
This addLines(FigureLine[] lines...)

Add individual lines to the figure. Coordinates are specified relative to the plot area, not in pixels. The lines are is clipped to the visible part of the plot area. This is useful for adding annotation lines, as opposed to plot lines.

addPlot
This addPlot(Plot[] plots...)
This addPlot(P[] plots)

Add one or more plots to the figure.

axesFont
Font axesFont()
axesFont
This axesFont(Font newFont)
bottomMost
double bottomMost()

The bottommost point on the figure.

defaultXTick
This defaultXTick()

Resets the X tick labels to the default, effectively undoing a call to xTickLabels.

defaultYTick
This defaultYTick()

Resets the X tick labels to the default, effectively undoing a call to xTickLabels.

defaultZoom
This defaultZoom()

Set the zoom back to the default value, i.e. just large enough to fit everything on the screen.

drawImpl
void drawImpl()

Draw the plot but don't display it on screen.

gridIntensity
ubyte gridIntensity()

Grid intensity from zero (pure white) to 255 (pure black).

gridIntensity
This gridIntensity(ubyte newIntensity)

Setter.

horizontalGrid
bool horizontalGrid()

Determines whether horizontal gridlines are drawn. Default is false.

horizontalGrid
This horizontalGrid(bool val)
leftMost
double leftMost()

The leftmost point on the figure.

legendFont
Font legendFont()
legendFont
This legendFont(Font newFont)
legendLocation
LegendLocation legendLocation()
legendLocation
This legendLocation(LegendLocation newLoc)
removePlot
This removePlot(Plot[] plots...)
This removePlot(P[] plots)

Remove one or more plots from the figure. If the plots are not in the figure, they are silently ignored.

rightMost
double rightMost()

The rightmost point on the figure.

rotatedXTick
bool rotatedXTick()

Determines whether rotated text is used for the X tick labels.

rotatedXTick
This rotatedXTick(bool newVal)

Setter

rotatedYTick
bool rotatedYTick()

Determines whether rotated text is used for the Y tick labels.

rotatedYTick
This rotatedYTick(bool newVal)

Setter

topMost
double topMost()

The topmost point on the figure.

verticalGrid
bool verticalGrid()

Determines whether vertical gridlines are drawn. Default is false.

verticalGrid
This verticalGrid(bool val)
xLim
This xLim(double newLower, double newUpper)

Manually set the X axis limits.

xTickLabels
This xTickLabels(R locations, const string[] text = null, Color[] colors = null)

Set the X axis labels. If text is null (default) the axis text is just the text of the axis locations. R should be any range with length identical to text (unless text is null) and elements implicitly convertible to double. If colors is empty, all labels will be made black. Otherwise it must be the same length as locations.

yLim
This yLim(double newLower, double newUpper)

Manually set the Y axis limits.

yTickLabels
This yTickLabels(R locations, const string[] text = null, Color[] colors = null)

Set the Y axis labels. If text is null (default) the axis text is just the text of the axis locations. R should be any range with length identical to text (unless text is null) and elements implicitly convertible to double. If colors is empty, all labels will be made black. Otherwise it must be the same length as locations.

Static functions

opCall
Figure opCall()
opCall
Figure opCall(Plot[] plots...)
Figure opCall(P[] plots)

Convenience factory that adds all plots provided to the Figure.

Inherited Members

From FigureBase

saveToFile
void saveToFile(string filename, string type, double width = 0, double height = 0)

Saves this figure to a file. The file type can be one of either the raster formats .png, .jpg, .tiff, and .bmp, or the vector formats .pdf, .svg and .eps. The width and height parameters allow you to specify explicit width and height parameters for the image file. If width and height are left at their default values of 0, the default width and height of the subclass being saved will be used.

saveToFile
void saveToFile(string filename, double width = 0, double height = 0)

Convenience function that infers the type from the filename extenstion and defaults to .png if no valid file format extension is found.

toWidget
FigureWidget toWidget()

Creates a Widget that will have this object drawn to it. This Widget can be displayed in a window.

showAsMain
void showAsMain()

Draw and display the figure as a main form. This is useful in otherwise console-based apps that want to display a few plots. However, you can't have another main form up at the same time.

getDefaultWindow
gtk.Window.Window getDefaultWindow()

Returns a default plot window with this figure in it.

Examples

1 auto nums = [1,1,1,1,2,2,3,3,4,5,6,7];
2 auto hist = Histogram(nums, 10);
3 auto fig = new Figure;
4 fig.addPllot(hist);
5 fig.title = "A plot";
6 fig.xLabel = "X label";
7 fig.yLabel = "Y label";
8 fig.showAsMain();

Meta