Class ScatterPlot

Class Documentation

class ScatterPlot

Public Functions


Construct with default basic data (for test plots).

void setColor(const std::string &value)

set solid line colour as a string.

See for an example of different colour scales and values available See for plotly’s master colour reference For reference, plotly’s default colours are: [ ‘#1f77b4’, # muted blue ‘#ff7f0e’, # safety orange ‘#2ca02c’, # cooked asparagus green ‘#d62728’, # brick red ‘#9467bd’, # muted purple ‘#8c564b’, # chestnut brown ‘#e377c2’, # raspberry yogurt pink ‘#7f7f7f’, # middle gray ‘#bcbd22’, # curry yellow-green ‘#17becf’ # blue-teal ]

  • value: std::string plotly colour value, e.g. setColor(“#1f77b4”)

void setDash(const std::string &value)

set the line dash mode for this scatter plot.

This is a helper function, which directly modifies a ‘line’ object, allowing a clean API for the user to update scatter plots.

Accepts “solid”, “dot”, “dash”, “longdash”, “dashdot”, or “longdashdot”

  • dash_type: std::string selected dash type

void setWidth(const int value)

set the line width in pixels.

  • value: int the width in pixels for the line

Public Members

Eigen::VectorXd x
Eigen::VectorXd y
std::string name = ""

Protected Attributes

Line line


void to_json(nlohmann::json &j, const ScatterPlot &p)

Serialise scatter plot data into a valid json string.

Produces figure data JSON similar to: {“x”: [24.23, 3.4, 8.4], “y”: [20.1, 14.4, 23.3], “type”: “scatter”}