#include <Plot.h>
|
| Plot (const std::string &title="") |
|
void | clear_file () |
|
void | title (const std::string &title) |
|
void | xAxis (const std::string &name) |
|
void | yAxis (const std::string &name) |
|
void | pointSize (const int &size) |
|
void | lineWidth (const int &size) |
|
void | AddData (const Matrix< double > &x, const Matrix< double > &y, const std::string &name, DataTypes dataType=DataTypes::NONE, const char *character=nullptr) |
|
void | AddData (const Matrix< double > &mat, const std::string &name, DataTypes dataTypeName=DataTypes::NONE, const char *pointChar=nullptr, int dimensions=2) |
|
virtual void | operator() () const |
|
Represents a data plot, using gnuplot.
Add data using the AddData methods. After you are done, call the plot to display the results.
Examples:
plot.AddData({{1, 2}, {2, 3}}, "Some points", DataType::POINT);
plot();
- Examples
- numerics/analysis/TestDifferentiation.cpp, numerics/lin_alg/TestSVD.cpp, and plot/TestPlot.cpp.
◆ Plot()
Plot::Plot |
( |
const std::string & |
title = "" | ) |
|
|
inlineexplicit |
default constructor. Prepares context for adding data.
- Parameters
-
title | desired title for plot |
◆ AddData() [1/2]
void Plot::AddData |
( |
const Matrix< double > & |
mat, |
|
|
const std::string & |
name, |
|
|
DataTypes |
dataTypeName = DataTypes::NONE , |
|
|
const char * |
pointChar = nullptr , |
|
|
int |
dimensions = 2 |
|
) |
| |
|
inline |
Appends data to the storage file
- Parameters
-
mat | matrix containing dataset |
name | name of data set |
dataTypeName | desired plot type |
dimensions | indicator for dimension of dataset |
◆ AddData() [2/2]
void Plot::AddData |
( |
const Matrix< double > & |
x, |
|
|
const Matrix< double > & |
y, |
|
|
const std::string & |
name, |
|
|
DataTypes |
dataType = DataTypes::NONE , |
|
|
const char * |
character = nullptr |
|
) |
| |
|
inline |
◆ clear_file()
void Plot::clear_file |
( |
| ) |
|
|
inline |
◆ getBoundaries()
calculates boundaries of given matrix (min and max values)
- Parameters
-
x | input vector to calculate boundaries of |
- Returns
- boundaries of input
◆ lineWidth()
void Plot::lineWidth |
( |
const int & |
size | ) |
|
|
inline |
setter for line width of plot data
- Parameters
-
◆ operator()()
virtual void Plot::operator() |
( |
| ) |
const |
|
inlinevirtual |
execution using call operator
Forwards data to gnuplot
Reimplemented in SurfacePlot.
◆ pointSize()
void Plot::pointSize |
( |
const int & |
size | ) |
|
|
inline |
◆ title()
void Plot::title |
( |
const std::string & |
title | ) |
|
|
inline |
Setter for title label
- Parameters
-
◆ writeAttributes()
void Plot::writeAttributes |
( |
FILE * |
gnuplot | ) |
const |
|
inlineprotected |
helper to write attributes to gnuplot context
- Parameters
-
gnuplot | pointer to gnuplot stream |
◆ xAxis()
void Plot::xAxis |
( |
const std::string & |
name | ) |
|
|
inline |
◆ yAxis()
void Plot::yAxis |
( |
const std::string & |
name | ) |
|
|
inline |
◆ attributes
◆ bX
y-axis boundaries for the resulting plot
◆ bY
x-axis boundaries for the resulting plot
◆ dataFileName
const char* Plot::dataFileName |
|
protected |
◆ numElements
int Plot::numElements = 0 |
|
protected |
number elements within the plot
◆ plotType
const char* Plot::plotType = "plot" |
|
protected |
representation of plot type
◆ plotTypeName
const char* Plot::plotTypeName |
|
protected |
representation of plot type
◆ storageFile
FILE* Plot::storageFile = nullptr |
|
protected |
The documentation for this class was generated from the following file:
- include/math/visualization/Plot.h