Skip to main content

Plot

Namespace: DISPLIB  ·  Library: Display Library

#include <disp/plot.h>

class DISPLIB::Plot

MATLAB-style line plot for an Eigen vector, derived from Graph.

Owns a list of QVector<QPointF> trace paths and supports a m_bHoldOn flag for overlaying multiple curves. updateData() replaces the visible curve in place.

src/examples/ex_disp_plots/main.cpp
VectorXd samples = VectorXd::LinSpaced(50, -1.0, 1.0);
Plot plot(samples); // Plot is a Graph with title and axis labels
plot.setTitle("ramp");
plot.setXLabel("sample");
plot.setYLabel("value");

Inheritance​


Public Methods​

Plot(parent)​

Creates the plot.

Parameters:

  • parent : *QWidget ** Parent QObject (optional).

Plot(p_dVec, parent)​

Creates the plot using a given double vector.

Parameters:

  • p_dVec : Eigen::VectorXd & The double data vector.

  • parent : *QWidget ** Parent QObject (optional).


~Plot()​

Destructs the Plot object.


init()​

Initializes the Plot object.


updateData(p_dVec)​

Updates the plot using a given double vector without given X data.

Parameters:

  • p_dVec : Eigen::VectorXd & The double data vector.

Example​

Used in examples​

ex_connectivity​

Example of using the MNE-CPP Connectivity library.

src/examples/ex_connectivity/connectivitysettingsmanager.h, line 109
DISPLIB::Plot* m_pSignalCoursePlot = nullptr;
DISPLIB::Plot* m_pSpectrumPlot = nullptr;
DISPLIB::Plot* m_pEvokedSignalCoursePlot = nullptr;
DISPLIB::Plot* m_pEpochSignalCoursePlot = nullptr;
DISPLIB::Plot* m_pEvokedSourceSignalCoursePlot = nullptr;
DISPLIB::ImageSc* m_pImageConnWeights = nullptr;

ex_spectral​

Example of the computation of spectra, PSD and CSD.

src/examples/ex_spectral/main.cpp, line 84
//Plot hanning window
VectorXd hann = matTaps.row(0).transpose();
Plot plotWindow(hann);
plotWindow.setTitle("Hanning window");
plotWindow.setXLabel("X Axes");
plotWindow.setYLabel("Y Axes");
plotWindow.setWindowTitle("Corresponding function to MATLABs plot");
plotWindow.show();

ex_disp​

Disp library widgets: image map, line plot and time-frequency plot of raw data.

src/examples/ex_disp/main.cpp, line 207
//Plot example
VectorXd dataCol = data.col(0);
Plot plot(dataCol);
plot.setTitle("Data Row 0 Plot");
plot.setXLabel("X Axes");
plot.setYLabel("Y Axes");
plot.setWindowTitle("Corresponding function to MATLABs plot");
plot.show();

Also used in ex_disp_plots, ex_tf_plot.

Authors of this file​