Class ScatterPlot¶
- Defined in File scatter.h
Class Documentation¶
-
class
ScatterPlot
¶ Public Functions
-
ScatterPlot
()¶ Construct with default basic data (for test plots).
-
void
setColor
(const std::string &value)¶ set solid line colour as a string.
See https://plot.ly/ipython-notebooks/color-scales/#6-colors for an example of different colour scales and values available See https://github.com/plotly/plotly.py/blob/master/plotly/colors.py#L83-L87 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 ]
- Parameters
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”
- Parameters
dash_type
: std::string selected dash type
-
void
setWidth
(const int value)¶ set the line width in pixels.
- Parameters
value
: int the width in pixels for the line
Friends
-
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”}
-