plotpp::Points
Represents a point plot from x- and y-coordiantes. More...
#include <Points.hpp>
Inherits from plotpp::IPlot
Public Functions
Name | |
---|---|
Points(optional_ptr< Tx > x, optional_ptr< Ty > y) Constructs a Points plot with optional x and y coordinate ranges. |
|
Points(Points const & ) =default Default copy constructor. |
|
Points(Points && ) =default Default move constructor. |
|
Points & | operator=(Points const & ) =default Default copy assignment constructor. |
Points & | operator=(Points && ) =default Default move assignment constructor. |
Points & | label(const PlotTitle & label) Sets the label to be seen in the legend of the plot. |
Points && | label(const PlotTitle & label) Sets the label to be seen in the legend of the plot. |
Points & | label(PlotTitle && label) Sets the label to be seen in the legend of the plot. |
Points && | label(PlotTitle && label) Sets the label to be seen in the legend of the plot. |
PointType | pointType() const Gets the point type. |
Points & | pointType(PointType pt) Sets the point type. |
Points && | pointType(PointType pt) Sets the point type. |
float | pointSize() const Gets the point size. |
Points & | pointSize(float ps) Sets the point size. |
Points && | pointSize(float ps) Sets the point size. |
Color | color() const Gets the plot color. |
Points & | color(Color col) Sets the point color. |
Points && | color(Color col) Sets the point color. |
bool | isAutoColor() const Tells whether automatic coloring is enabled. |
Points & | setAutoColor() Enables automatic coloring with multiple plots. |
Points && | setAutoColor() Enables automatic coloring with multiple plots. |
virtual void | printPlot(FILE * fptr) const override prints the plot command for gnuplot |
virtual void | printData(FILE * fptr) const override prints the data for gnuplot |
Additional inherited members
Public Functions inherited from plotpp::IPlot
Name | |
---|---|
IPlot() =default | |
IPlot(std::string label) | |
virtual | ~IPlot() |
virtual void | printSettings(std::ostream & stream) const =delete |
virtual void | printSettings(FILE * fptr) const |
Protected Functions inherited from plotpp::IPlot
Name | |
---|---|
virtual IPlot & | uid(size_t & uid_io) |
size_t | uid() const |
Friends inherited from plotpp::IPlot
Name | |
---|---|
class | Figure |
Detailed Description
template <class Tx ,
class Ty >
class plotpp::Points;
Represents a point plot from x- and y-coordiantes.
Template Parameters:
- Tx Type for x-coordinate range, must satisfy std::ranges::forward_range (aka. have forward
begin()
andend()
iterators) - Ty Type for y-coordinate range, must satisfy std::ranges::forward_range ()
The Point class holds information about how to draw a point plot in a figure. It supports various customizations such as point type, color, and fill styles.
Public Functions Documentation
function Points
inline Points(
optional_ptr< Tx > x,
optional_ptr< Ty > y
)
Constructs a Points plot with optional x and y coordinate ranges.
Parameters:
- x Optional pointer to the x-coordinate range.
- y Pointer to the y-coordinate range.
Suggestion: Use these construction helpers instead:
function Points
Points(
Points const &
) =default
Default copy constructor.
function Points
Points(
Points &&
) =default
Default move constructor.
function operator=
Points & operator=(
Points const &
) =default
Default copy assignment constructor.
function operator=
Points & operator=(
Points &&
) =default
Default move assignment constructor.
function label
inline Points & label(
const PlotTitle & label
)
Sets the label to be seen in the legend of the plot.
Parameters:
- label : PlotTitle - A title of the plot containing the label to be displayed in the legend
Return: Points - Self, for method chaining
function label
inline Points && label(
const PlotTitle & label
)
Sets the label to be seen in the legend of the plot.
Parameters:
- label : PlotTitle - A title of the plot containing the label to be displayed in the legend
Return: Points - Self, for method chaining
function label
inline Points & label(
PlotTitle && label
)
Sets the label to be seen in the legend of the plot.
Parameters:
- label : PlotTitle - A title of the plot containing the label to be displayed in the legend
Return: Points - Self, for method chaining
function label
inline Points && label(
PlotTitle && label
)
Sets the label to be seen in the legend of the plot.
Parameters:
- label : PlotTitle - A title of the plot containing the label to be displayed in the legend
Return: Points - Self, for method chaining
function pointType
inline PointType pointType() const
Gets the point type.
Return: PointType - The current point type
function pointType
inline Points & pointType(
PointType pt
)
Sets the point type.
Parameters:
- pt : PointType - The new point type
Return: Points - Self, for method chaining
function pointType
inline Points && pointType(
PointType pt
)
Sets the point type.
Parameters:
- pt : PointType - The new point type
Return: Points - Self, for method chaining
function pointSize
inline float pointSize() const
Gets the point size.
Return: float - The current point size
function pointSize
inline Points & pointSize(
float ps
)
Sets the point size.
Parameters:
- ps : float - The new point size
Return: Points - Self, for method chaining
function pointSize
inline Points && pointSize(
float ps
)
Sets the point size.
Parameters:
- ps : float - The new point size
Return: Points - Self, for method chaining
function color
inline Color color() const
Gets the plot color.
Return: Color - The current point color
function color
inline Points & color(
Color col
)
Sets the point color.
Parameters:
- col : Color - The new point color
Return: Points - Self, for method chaining
function color
inline Points && color(
Color col
)
Sets the point color.
Parameters:
- col : Color - The new point color
Return: Points - Self, for method chaining
function isAutoColor
inline bool isAutoColor() const
Tells whether automatic coloring is enabled.
Return: bool - true
if automatic coloring is enabled, false
otherwise
function setAutoColor
inline Points & setAutoColor()
Enables automatic coloring with multiple plots.
Return: Points - Self, for method chaining
function setAutoColor
inline Points && setAutoColor()
Enables automatic coloring with multiple plots.
Return: Points - Self, for method chaining
function printPlot
inline virtual void printPlot(
FILE * fptr
) const override
prints the plot command for gnuplot
Parameters:
- file : FILE - A pointer to the stream/file that the plot command shall be written to.
Reimplements: plotpp::IPlot::printPlot
This function does normally not need to be called by the user. The class Figure will take care it and the communication with Gnuplot.
function printData
inline virtual void printData(
FILE * fptr
) const override
prints the data for gnuplot
Parameters:
- file : FILE - A pointer to the stream/file that the plot command shall be written to.
Reimplements: plotpp::IPlot::printData
This function does normally not need to be called by the user. The class Figure will take care it and the communication with Gnuplot.
Updated on 2025-03-02 at 14:13:17 +0100