Skip to content

plotpp::Boxes

class for plotting boxes into a plotpp::Figure More...

#include <Boxes.hpp>

Inherits from plotpp::IPlot

Public Functions

Name
Boxes(optional_ptr< Tx > x, optional_ptr< Ty > y)
Constructs boxes at x position with height y.
Boxes & label(const PlotTitle & label)
Sets the label to be seen in the legend of the plot.
Boxes && label(const PlotTitle & label)
Sets the label to be seen in the legend of the plot.
Boxes & label(PlotTitle && label)
Sets the label to be seen in the legend of the plot.
Boxes && label(PlotTitle && label)
Sets the label to be seen in the legend of the plot.
float boxWidth() const
returns the width of the boxes as a float number
Boxes & boxWidth(float bw)
sets the absolute width of the boxes
Boxes && boxWidth(float bw)
sets the absolute width of the boxes
bool isRelativeBoxWidth() const
Boxes & relativeBoxWidth(bool rbw =true)
sets the box width to relative or absolute
Boxes && relativeBoxWidth(bool rbw =true)
sets the box width to relative or absolute
const FillStyle & fill() const
Boxes & fillSolid(float opacity =0.6, bool transparent =false)
sets the box fill style to a solid fillClear
Boxes && fillSolid(float opacity =0.6, bool transparent =false)
sets the box fill style to a solid fillClear
Boxes & fillClear()
removes any fill-styles
Boxes && fillClear()
removes any fill-styles
Boxes & fillPattern(int n)
uses a gnuplot fill pattern. May be useful for black and white printing.
Boxes && fillPattern(int n)
uses a gnuplot fill pattern. May be useful for black and white printing.
Boxes & border(bool b =true)
sets the border of the box
Boxes && border(bool b =true)
sets the border of the box
virtual void printSettings(FILE * fptr) const override
prints extra commands that are not within the gnuplot plot command
virtual void printData(FILE * fptr) const override
prints the data for gnuplot
virtual void printPlot(FILE * fptr) const override
prints the plot command for gnuplot

Additional inherited members

Public Functions inherited from plotpp::IPlot

Name
IPlot() =default
IPlot(std::string label)
virtual ~IPlot()

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::Boxes;

class for plotting boxes into a plotpp::Figure

Template Parameters:

  • TxTy Generic types that store the data for plotting and are forward ranges (aka. have begin() and end() iterators)

to construct boxes See:

  • boxes(U1&& x, U2&& y)
  • boxes(U2&& y)

Public Functions Documentation

function Boxes

inline Boxes(
    optional_ptr< Tx > x,
    optional_ptr< Ty > y
)

Constructs boxes at x position with height y.

Parameters:

Suggestion: Use these construction helpers instead:

  • boxes(U1&& x, U2&& y)
  • boxes(U2&& y)

function label

inline Boxes & 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: Boxes - Self, for method chaining

function label

inline Boxes && 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: Boxes - Self, for method chaining

function label

inline Boxes & 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: Boxes - Self, for method chaining

function label

inline Boxes && 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: Boxes - Self, for method chaining

function boxWidth

inline float boxWidth() const

returns the width of the boxes as a float number

Return: float - the width of the boxes

function boxWidth

inline Boxes & boxWidth(
    float bw
)

sets the absolute width of the boxes

Parameters:

  • bw : float - the new box width

Return: Boxes - Self, for method chaining

function boxWidth

inline Boxes && boxWidth(
    float bw
)

sets the absolute width of the boxes

Parameters:

  • bw : float - the new box width

Return: Boxes - Self, for method chaining

function isRelativeBoxWidth

inline bool isRelativeBoxWidth() const

Return: bool - true if the plot uses a relative box width

function relativeBoxWidth

inline Boxes & relativeBoxWidth(
    bool rbw =true
)

sets the box width to relative or absolute

Parameters:

  • rbw : float - if true (default): uses relative box width, if false: uses absolute box widths

Return: Boxes - Self, for method chaining

function relativeBoxWidth

inline Boxes && relativeBoxWidth(
    bool rbw =true
)

sets the box width to relative or absolute

Parameters:

  • rbw : float - if true (default): uses relative box width, if false: uses absolute box widths

Return: Boxes - Self, for method chaining

function fill

inline const FillStyle & fill() const

Return: FillStyle - The fillstyle of the plot

function fillSolid

inline Boxes & fillSolid(
    float opacity =0.6,
    bool transparent =false
)

sets the box fill style to a solid fillClear

Parameters:

  • opacity : float - sets the opacity of the fill (default is 0.6)
  • transparent : bool - if true: makes the fill transparent, opacity acts like alpha value; if false (default): cannot see through filled areas

Return: Boxes - Self, for method chaining

function fillSolid

inline Boxes && fillSolid(
    float opacity =0.6,
    bool transparent =false
)

sets the box fill style to a solid fillClear

Parameters:

  • opacity : float - sets the opacity of the fill (default is 0.6)
  • transparent : bool - if true: makes the fill transparent, opacity acts like alpha value; if false (default): cannot see through filled areas

Return: Boxes - Self, for method chaining

function fillClear

inline Boxes & fillClear()

removes any fill-styles

Return: Boxes - Self, for method chaining

function fillClear

inline Boxes && fillClear()

removes any fill-styles

Return: Boxes - Self, for method chaining

function fillPattern

inline Boxes & fillPattern(
    int n
)

uses a gnuplot fill pattern. May be useful for black and white printing.

Parameters:

  • n : int - the number of the pattern

Return: Boxes - Self, for method chaining

function fillPattern

inline Boxes && fillPattern(
    int n
)

uses a gnuplot fill pattern. May be useful for black and white printing.

Parameters:

  • n : int - the number of the pattern

Return: Boxes - Self, for method chaining

function border

inline Boxes & border(
    bool b =true
)

sets the border of the box

Parameters:

  • b : bool - if true (default): enables the border; if false: disables the border

Return: Boxes - Self, for method chaining

function border

inline Boxes && border(
    bool b =true
)

sets the border of the box

Parameters:

  • b : bool - if true (default): enables the border; if false: disables the border

Return: Boxes - Self, for method chaining

function printSettings

inline virtual void printSettings(
    FILE * fptr
) const override

prints extra commands that are not within the gnuplot plot command

Parameters:

  • file : FILE - A pointer to the stream/file that the plot command shall be written to.

Reimplements: plotpp::IPlot::printSettings

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.

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.


Updated on 2025-03-02 at 14:13:16 +0100