SubplotBase

This is the GUI-agnostic base class for a Subplot. See the Subplot class, which derives from this class and has a few GUI-specific things added.

Subplot objects allows for one or more subplots to be created in a single window or a single file. Each subplot is represented by a FigureBase. In the default plot window, double-clicking on any subplot zooms in on it. Double-clicking again zooms out.

Constructors

this
this()
Undocumented in source.
this
this(uint nRows, uint nColumns)
Undocumented in source.

Members

Functions

addFigure
This addFigure(FigureBase[] toAdd)
This addFigure(F[] toAdd)

Add a figure to the subplot using the default layout, which is as follows:

addFigure
This addFigure(FigureBase fig, uint row, uint col)

Add a figure to the subplot in the given row and column.

defaultWindowHeight
int defaultWindowHeight()
Undocumented in source. Be warned that the author may not have intended to support it.
defaultWindowWidth
int defaultWindowWidth()
Undocumented in source. Be warned that the author may not have intended to support it.
drawImpl
void drawImpl()
Undocumented in source. Be warned that the author may not have intended to support it.
minWindowHeight
int minWindowHeight()
Undocumented in source. Be warned that the author may not have intended to support it.
minWindowWidth
int minWindowWidth()
Undocumented in source. Be warned that the author may not have intended to support it.
zoomedFigure
FigureBase zoomedFigure()

Returns the zoomed figure, or null if no figure is currently zoomed.

Static functions

opCall
Subplot opCall(uint nRows, uint nColumns)

Create an instance with nRows rows and nColumns columns.

opCall
Subplot opCall()

Create an empty Subplot instance.

Inherited Members

From FigureBase

fontSizeAdjust
enum fontSizeAdjust;
Undocumented in source.
context
Context context;
Undocumented in source.
drawLine
void drawLine(Pen pen, double startX, double startY, double endX, double endY)
Undocumented in source. Be warned that the author may not have intended to support it.
drawLine
void drawLine(Pen pen, PlotPoint start, PlotPoint end)
Undocumented in source. Be warned that the author may not have intended to support it.
drawRectangle
void drawRectangle(Pen pen, double x, double y, double width, double height)
Undocumented in source. Be warned that the author may not have intended to support it.
drawRectangle
void drawRectangle(Pen pen, Rect r)
Undocumented in source. Be warned that the author may not have intended to support it.
fillRectangle
void fillRectangle(Brush brush, double x, double y, double width, double height)
Undocumented in source. Be warned that the author may not have intended to support it.
fillRectangle
void fillRectangle(Brush brush, Rect r)
Undocumented in source. Be warned that the author may not have intended to support it.
drawText
void drawText(string text, Font font, Color pointColor, PlotRect rect, TextAlignment alignment)
Undocumented in source. Be warned that the author may not have intended to support it.
drawTextCurrentContext
void drawTextCurrentContext(string text, Font font, Color pointColor, PlotRect rect, TextAlignment alignment)
Undocumented in source. Be warned that the author may not have intended to support it.
drawText
void drawText(string text, Font font, Color pointColor, PlotRect rect)
Undocumented in source. Be warned that the author may not have intended to support it.
drawRotatedText
void drawRotatedText(string text, Font font, Color pointColor, PlotRect rect, TextAlignment alignment)
Undocumented in source. Be warned that the author may not have intended to support it.
drawRotatedText
void drawRotatedText(string text, Font font, Color pointColor, PlotRect rect)
Undocumented in source. Be warned that the author may not have intended to support it.
measureText
PlotSize measureText(string text, Font font, double maxWidth, TextAlignment alignment)
Undocumented in source. Be warned that the author may not have intended to support it.
measureText
PlotSize measureText(string text, Font font, double maxWidth)
Undocumented in source. Be warned that the author may not have intended to support it.
measureText
PlotSize measureText(string text, Font font)
Undocumented in source. Be warned that the author may not have intended to support it.
getBrush
Brush getBrush(Color color)
Undocumented in source. Be warned that the author may not have intended to support it.
getPen
Pen getPen(Color color, double width)
Undocumented in source. Be warned that the author may not have intended to support it.
drawTo
void drawTo(Context context)
Undocumented in source. Be warned that the author may not have intended to support it.
drawTo
void drawTo(Context context, double width, double height)
Undocumented in source. Be warned that the author may not have intended to support it.
drawTo
void drawTo(Context context, PlotRect whereToDraw)
Undocumented in source. Be warned that the author may not have intended to support it.
saveToFile
void saveToFile(string filename, string type, double width, double height)

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, double height)

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

auto histFig = Histogram(someNumbers, 10).toFigure;
auto scatterFig = ScatterPlot(someNumbers, someMoreNumbers).toFigure;
auto sub = SubPlot(1, 2);  // 1 row, 2 columns.
sub.addPlot(histFig, 0, 0);  // Add the histogram in the 0th row, 0th column.
sub.addPlot(scatterFig, 0, 1);  // Ditto.
sub.showAsMain();

Meta