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.
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
- Full source:
src/examples/ex_disp_plots/main.cpp - Build target:
ex_disp_plots(runs under CTest)
Used in examples
ex_connectivity
Example of using the MNE-CPP Connectivity library.
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.
//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.
//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
- Lorenz Esch <lorenz.esch@tu-ilmenau.de>
- Juan GPC <jgarciaprieto@mgh.harvard.edu>
- Gabriel Motta <gabrielbenmotta@gmail.com>
- Christoph Dinh <christoph.dinh@mne-cpp.org>