27 #ifndef SIMPLEPLOTTER_H_
28 #define SIMPLEPLOTTER_H_
124 double size = 5,
bool outline =
true);
141 bool overplot =
true);
143 bool overplot =
true);
145 bool overplot =
true);
148 bool overplot =
true);
150 bool overplot =
true);
152 bool overplot =
true);
170 BarPlotPtr
barPlot(
double*& x,
double*& y,
unsigned int n,
171 bool overplot =
false);
172 BarPlotPtr
barPlot(
float*& x,
float*& y,
unsigned int n,
173 bool overplot =
false);
174 BarPlotPtr
barPlot(
int*& x,
int*& y,
unsigned int n,
175 bool overplot =
false);
178 bool overplot =
false);
180 bool overplot =
false);
182 bool overplot =
false);
184 BarPlotPtr
barPlot(PlotPointDataPtr
data,
bool overplot =
false);
191 unsigned int numBins,
bool overplot=
false);
193 unsigned int numBins,
bool overplot=
false);
195 unsigned int numBins,
bool overplot=
false);
197 bool overplot =
false);
199 bool overplot =
false);
201 bool overplot =
false);
204 bool overplot =
false);
215 double fromY,
double toY,
bool overplot =
false);
217 double fromY,
double toY,
bool overplot =
false);
219 double fromY,
double toY,
bool overplot =
false);
221 double fromY,
double toY,
bool overplot =
false);
222 RasterPlotPtr
rasterPlot(PlotRasterDataPtr
data,
bool overplot =
false);
225 bool overplot =
false);
227 bool overplot =
false);
229 bool overplot =
false);
231 bool overplot =
false);
234 bool overplot =
false);
237 bool overplot =
false);
240 bool overplot =
false);
243 bool overplot =
false);
244 RasterPlotPtr
contourPlot(PlotRasterDataPtr
data, std::vector<double>& contours,
245 bool overplot =
false);
252 double fromY,
double toY,
bool overplot =
false);
254 double fromY,
double toY,
bool overplot =
false);
256 double fromY,
double toY,
bool overplot =
false);
258 double fromY,
double toY,
bool overplot =
false);
259 RasterPlotPtr
spectrogram(PlotRasterDataPtr
data,
bool overplot =
false);
262 bool overplot =
false);
264 bool overplot =
false);
266 bool overplot =
false);
268 bool overplot =
false);
271 bool overplot =
false);
274 bool overplot =
false);
277 bool overplot =
false);
280 bool overplot =
false);
281 RasterPlotPtr
spectrogram(PlotRasterDataPtr
data, std::vector<double>& contours,
282 bool overplot =
false);
286 PlotPointPtr
plotPoint(
double x,
double y);
296 PlotShapeRectanglePtr
rectangle(
double left,
double top,
297 double right,
double bottom);
303 double xRadius,
double yRadius);
314 PlotShapeArrowPtr
arrow(
double xFrom,
double yFrom,
315 double xTo,
double yTo);
318 PlotShapeArrowPtr
lineSegment(
double xFrom,
double yFrom,
319 double xTo,
double yTo);
374 int width = -1,
int height = -1);
380 int width = -1,
int height = -1);
PlotLinePtr m_line
Line for future plots.
~SimplePlotter()
Destructor.
bool exportPNG(const casacore::String &location, bool highQuality=false, int width=-1, int height=-1)
Exports the plotter to a PNG file at the given location.
void clearSelectedRegions()
Clears the canvas' list of selected regions.
void showCartesianAxes(bool show=true)
Show/hide Cartesian axes.
casacore::String fileChooserDialog(const casacore::String &title="File Chooser", const casacore::String &directory="")
Export Methods.
BarPlotPtr barPlot(double *&x, double *&y, unsigned int n, bool overplot=false)
Display a bar plot for the given data, using the current line and area fill.
void setLine(const casacore::String &color, PlotLine::Style style=PlotLine::SOLID, double width=1.0)
Set the line for future plots to the given characteristics.
PlotFactoryPtr getFactory()
Accessor methods.
void showDefaultExportTools(bool show=true)
Show or hide default "export tools" panel - i.e., saving to a file.
casacore::CountedPtr< SimplePlotter > SimplePlotterPtr
bool exportPS(const casacore::String &location, bool highQuality=false, int dpi=-1)
Exports the plotter to a PS file at the given location.
PlotAreaFillPtr getAreaFill()
Returns the current PlotAreaFill used for shapes, histograms, etc.
BarPlotPtr histogramPlot(double *&data, unsigned int n, unsigned int numBins, bool overplot=false)
Display a histogram for the given data in the given number of bins, using the current line and area f...
PlotterPtr m_plotter
Plotter, with single canvas.
SMART POINTER DEFINITIONS PlotItemPtr PlotShapeLinePtr
void setAxesAutoRescale(bool on=true)
When future items are added to the canvas, automatically rescale the axes to show all items...
PlotShapeArrowPtr lineSegment(double xFrom, double yFrom, double xTo, double yTo)
Draw a line segment from the given point to the given point.
PlotShapeEllipsePtr ellipse(double centerX, double centerY, double xRadius, double yRadius)
Draw an ellipse with the given point as the center and the given x and y radii.
void setWindowTitle(const casacore::String &windowTitle)
Plotter customization.
A 2-D Specialization of the Array class.
Pattern
Pattern enum, similar in spirit to http://doc.trolltech.com/4.3/qt.html#BrushStyle-enum.
SMART POINTER DEFINITIONS PlotShapeEllipsePtr
void setXAxisRange(double from, double to)
Implies setAxesAutoRescale(false)
void show(const variant &v)
PlotFactoryPtr m_factory
Factory.
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
TableExprNode pattern(const TableExprNode &node)
void showLines(bool showLines=true)
Plot customization.
PlotPointPtr plotPoint(double x, double y)
Plot a point at the given location, using the current symbol.
ScatterPlotPtr ploty(double *&y, unsigned int n, bool overplot=true)
PlotStandardMouseToolGroupPtr m_mouseTools
Mouse tools.
void clear()
Clearing Methods.
PlotCanvasPtr m_canvas
Canvas.
PlotCanvasPtr getCanvas()
Returns the PlotCanvas.
bool exportPDF(const casacore::String &location, bool highQuality=false, int dpi=-1)
Exports the plotter to a PDF file at the given location.
void showDefaultHandTools(bool show=true)
Interaction Methods.
PlotShapeLinePtr xLine(double value)
Draw a line at the given x value.
ScatterPlotPtr plotxy(double *&x, double *&y, unsigned int n, bool overplot=true)
Plotting methods.
void rescaleAxes()
Automatically rescale the axes to show all items on the canvas.
RasterPlotPtr contourPlot(casacore::Matrix< double > &data, casacore::Vector< double > &contours, bool overplot=false)
PlotAnnotationPtr annotation(double x, double y, const casacore::String &text)
Shapes, Annotations, etc.
void setSymbol(PlotSymbol::Symbol symbol, const casacore::String &color="blue", double size=5, bool outline=true)
Set the symbol for future plots and points to the given characteristics.
PlotLinePtr getLine()
Returns the current PlotLine used to draw the plots.
void setAreaFill(const casacore::String &color, PlotAreaFill::Pattern pattern=PlotAreaFill::FILL)
Set the area fill for future histograms, shapes, etc.
PlotShapeLinePtr yLine(double value)
Draw a line at the given y value.
bool exportToFile(const PlotExportFormat &format)
Exports the plotter using the given format.
void setAxesLabels(const casacore::String &xLabel, const casacore::String &yLabel)
Sets the X_BOTTOM and Y_LEFT axes labels to the given.
RasterPlotPtr spectrogram(casacore::Matrix< double > &data, bool overplt=false)
bool exportJPG(const casacore::String &location, bool highQuality=false, int width=-1, int height=-1)
Exports the plotter to a JPG file at the given location.
PlotShapeRectanglePtr rectangle(double left, double top, double right, double bottom)
Draw a rectangle from the given upper left point to the given lower right point.
std::vector< PlotRegion > allSelectedRegions()
Returns all selected regions in the canvas' selected region list.
void holdDrawing()
Holds/Releases drawing on the canvas.
void clearPoints()
Clear just the points that have been accumulated using plotPoint calls.
RasterPlotPtr rasterPlot(casacore::Matrix< double > &data, bool overplot=false)
Display a raster or contour plot for the given data, using the current line for the contours if appli...
std::vector< PlotPointPtr > m_accumulatedPoints
Points accumulated using plotPoint calls.
PlotShapeArrowPtr arrow(double xFrom, double yFrom, double xTo, double yTo)
Draw an arrow from the given point to the given point.
PlotAreaFillPtr m_areaFill
Area fill for future histograms, shapes, etc.
void setCanvasTitle(const casacore::String &canvasTitle)
Sets the title of the canvas to the given.
SimplePlotter is a concrete class that uses the abstract plotting classes to perform common tasks...
String: the storage and methods of handling collections of characters.
int execLoop()
Execution methods.
void setYAxisRange(double from, double to)
Implies setAxesAutoRescale(false)
void showSymbols(bool showSymbols=true)
Turns symbols on or off for future plots and points.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the color(i.e.,"000000"for black) and
virtual unsigned int numBins() const =0
ABSTRACT METHODS //.
PlotSymbolPtr m_symbol
Symbol for future plots and points.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
PlotterPtr getPlotter()
Returns the Plotter.
PlotSymbolPtr getSymbol()
Returns the current PlotSymbol used for the plots and points.
SimplePlotter(PlotFactoryPtr factory)
Constructor that takes a factory to build plotting objects.