Skip to main content

Plot

Namespace: DISPLIB  ·  Library: Display Library  ·  Source: disp/plots/plot.h

#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​

Sensor- or source-level functional connectivity of averaged MEG/EEG data with a selectable metric, shown as a 3D network.

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_disp​

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

src/examples/ex_disp/main.cpp, line 221
//Plot example: the first channel over time
VectorXd dataCol = data.row(0).transpose();
VectorXd dataColFtCm = 1e13 * dataCol;
Plot plot(dataColFtCm);
plot.setTitle(raw.info.ch_names[picks(0)]);
plot.setXLabel("Sample");
plot.setYLabel("Amplitude [fT/cm]");
plot.setWindowTitle("Corresponding function to MATLABs plot");

ex_disp_plots​

Disp plots: colour maps, bar and spline histograms, line plots, image and time-frequency maps.

src/examples/ex_disp_plots/main.cpp, line 202
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");
const QImage plotImage = render(plot);
ok &= expect(countColor(plotImage, qRgb(255, 255, 255), 0) < plotImage.width() * plotImage.height(), "Plot renders axes and data");

Also used in ex_tf_plot.

Authors of this file​