Skip to content

plotpp

The libraries main-namespace.

Namespaces

Name
plotpp::color_map

Classes

Name
class plotpp::Arrows
class for plotting arrows/vectors/quivers in plotpp::Figure
class plotpp::Boxes
class for plotting boxes into a plotpp::Figure
class plotpp::Boxplot
class plotpp::Circle
class plotpp::Color
class plotpp::Figure
class plotpp::Filledcurves
class plotpp::FillStyle
class plotpp::Heatmap
class plotpp::Impulses
class plotpp::IPlot
class plotpp::Line
Represents a line plot from x- and y-coordiantes.
class plotpp::Multiplot
class plotpp::Piechart
struct plotpp::PlotTitle
class plotpp::Points
Represents a point plot from x- and y-coordiantes.
class plotpp::Steps
class plotpp::Text
class plotpp::XError
class plotpp::XYError
class plotpp::YError

Types

Name
enum class ArrowHeadStyle { nohead, head, filled_head, empty_head, backhead, filled_backhead, empty_backhead}
Enum for the differnt arrow head styles used for vectors, quivers and the like.
enum class DataRelation
enum class ImageFileType
enum class LineType
enum class OutputFileType
enum class int PointType
enum class TerminalType

Functions

Name
const char * to_command(ArrowHeadStyle ahs)
turns the enum plotpp::ArrowHeadStyle into its corresponding gnuplot command.
template <PtrOrMoved U1,PtrOrMoved U2,PtrOrMoved U3,PtrOrMoved U4>
auto
arrows(U1 && x1, U2 && y1, U3 && x2, U4 && y2)
helper constructor function to construct an arrows, where all coordinates are absolute to the graphs origin.
template <PtrOrMoved U1,PtrOrMoved U2,PtrOrMoved U3,PtrOrMoved U4>
auto
vector(U1 && x1, U2 && y1, U3 && x2, U4 && y2)
helper constructor function to construct vectors, where all coordinates are absolute to the graphs origin.
template <PtrOrMoved U1,PtrOrMoved U2,PtrOrMoved U3,PtrOrMoved U4>
auto
quiver(U1 && x, U2 && y, U3 && u, U4 && v)
helper constructor function to construct quivers (arrows), [x, y] are absolute starting positions and [u, v] are relative to the start of the arrow [x, y].
template <PtrOrMoved U1,PtrOrMoved U2>
auto
boxes(U1 && x, U2 && y)
template <PtrOrMoved U2>
auto
boxes(U2 && y)
template <PtrOrMoved U1,PtrOrMoved U2>
auto
boxplot(const U1 & x_scalar, U2 && y_range)
template <PtrOrMoved U2>
auto
boxplot(U2 && y_range)
Circle circle(float x, float y, float radius =1.0f, float startAngle =0.0f, float endAngle =360.0f)
Color operator+(const Color & l, const Color & r)
Color operator-(const Color & l, const Color & r)
Color operator*(const Color & l, const Color & r)
Color operator*(const Color & l, const float & r)
Color operator*(const float & l, const Color & r)
Color blend(const Color & a, const Color & b, const float & t)
template <size_t N>
Color
map(const float & v, const std::array< Color, N > & color_map)
template <PtrOrMoved U1,PtrOrMoved U2,PtrOrMoved U3>
auto
filledcurves(U1 && x, U2 && y1, U3 && y2)
template <PtrOrMoved U2,PtrOrMoved U3>
auto
filledcurves(U2 && y1, U3 && y2)
template <PtrOrMoved U1>
auto
heatmap(U1 && matrix, size_t rows, size_t columns, std::function< double(const remove_ptr_t< std::remove_reference_t< U1 > > &, size_t, size_t)> at, Text title ="")
template <MatrixLike U1>
auto
heatmap(U1 && matrix)
template <MatrixLike U1>
auto
heatmap(U1 * matrix)
template <class T ,size_t ROWS,size_t COLS>
auto
heatmap(const T(*) array[ROWS][COLS])
std::string_view to_string(ImageFileType filetype)
ImageFileType image_filetype_from_filename(std::string_view filename)
template <PtrOrMoved U1,PtrOrMoved U2>
auto
impulses(U1 && x, U2 && y)
template <PtrOrMoved U2>
auto
impulses(U2 && y)
template <PtrOrMoved Ux,PtrOrMoved Uy>
auto
line(Ux && x, Uy && y)
Construction helper function to create a Line instance with x- and y-coordinate ranges.
template <PtrOrMoved Uy>
auto
line(Uy && y)
Construction helper function to create a Line instance with x and y coordinate ranges.
std::string_view to_command(LineType dt)
std::string_view to_file_ending(OutputFileType t)
TerminalType to_terminal(OutputFileType t)
OutputFileType filetype_from_filename(std::string_view filename)
template <PtrOrMoved U1,class U2 >
auto
piechart(U1 && names, const U2 & values)
template <PtrOrMoved U1,class U2 >
auto
piechart(U1 && names, const U2 * values)
template <PtrOrMoved U2>
auto
piechart(const U2 & values)
template <PtrOrMoved U2>
auto
piechart(const U2 * values)
template <PtrOrMoved U1,PtrOrMoved U2>
auto
points(U1 && x, U2 && y)
Construction helper function to create a Plot instance with x- and y-coordinate ranges.
template <PtrOrMoved U1,PtrOrMoved U2>
auto
scatter(U1 && x, U2 && y)
Construction helper function to create a Plot instance with x- and y-coordinate ranges.
template <PtrOrMoved U2>
auto
points(U2 && y)
Construction helper function to create a Plot instance with x- and y-coordinate ranges.
template <PtrOrMoved U1,PtrOrMoved U2>
auto
scatter(U2 && y)
Construction helper function to create a Plot instance with x- and y-coordinate ranges.
template <PtrOrMoved U1,PtrOrMoved U2>
auto
steps(U1 && x, U2 && y)
template <PtrOrMoved U2>
auto
steps(U2 && y)
std::string_view to_command(TerminalType t)
std::ostream & operator<<(std::ostream & stream, const Text & text)
template <PtrOrMoved U1,PtrOrMoved U2,PtrOrMoved U3>
auto
xerror(U1 && x, U2 && y, U3 && xerr)
template <PtrOrMoved U1,PtrOrMoved U2,PtrOrMoved U3,PtrOrMoved U4>
auto
xyerror(U1 && x, U2 && y, U3 && xerr, U4 && yerr)
template <PtrOrMoved U1,PtrOrMoved U2,PtrOrMoved U3>
auto
yerror(U1 && x, U2 && y, U3 && yerr)

Types Documentation

enum ArrowHeadStyle

Enumerator Value Description
nohead
head
filled_head
empty_head
backhead
filled_backhead
empty_backhead

Enum for the differnt arrow head styles used for vectors, quivers and the like.

See: to_command(ArrowHeadStyle)

enum DataRelation

Enumerator Value Description
absolute
relative
polar

enum ImageFileType

Enumerator Value Description
NONE
png
jpeg
webp
gif

enum LineType

Enumerator Value Description
none -1
solid 1
dashed 2
doted 3
dash_doted 4
dash_doted2 5

enum OutputFileType

Enumerator Value Description
NONE
tex
cgm
pdf
dxf
emf
eps
fig
gif
jpeg
png
svg
webp
html
txt
gp

enum PointType

Enumerator Value Description
None -1
SmallDot 0
Plus 1
X 2
PlusX 3
Square 4
SquareFilled 5
Circle 6
CircleFilled 7
TriangleUp 8
TriangleUpFilled 9
TriangleDown 10
TriangleDownFilled 11
Rhombus 12
RhombusFilled 13
Heptagon 14
HeptagonFilled 15

enum TerminalType

Enumerator Value Description
NONE
cairolatex
canvas
cgm
context
domterm
dumb
txt
dxf
emf
epscairo
epslatex
fig
gif
hpgl
jpeg
kittycairo
kittygd
lua
pcl5
pdfcairo
pict2e
png
pngcairo
postscript
pslatex
pstex
pstricks
qt
sixelgd
svg
texdraw
tikz
tkcanvas
unknown
webp
windows
wxt

Functions Documentation

function to_command

const char * to_command(
    ArrowHeadStyle ahs
)

turns the enum plotpp::ArrowHeadStyle into its corresponding gnuplot command.

Return: a c-string with the command

function arrows

template <PtrOrMoved U1,
PtrOrMoved U2,
PtrOrMoved U3,
PtrOrMoved U4>
inline auto arrows(
    U1 && x1,
    U2 && y1,
    U3 && x2,
    U4 && y2
)

helper constructor function to construct an arrows, where all coordinates are absolute to the graphs origin.

Parameters:

  • x1y1 The start coordinates of the Arrow
  • x2y2 The end coordinates of the Arrow (absolute to the graphs origin)

Template Parameters:

  • U1U2U3U4 Can either be:

  • a pointer to data (The Arrow will not own the data, aka. not deconstruct it) or

  • data that is moved (The Arrow will own the data, aka. destruct it) Further the datatype has to be a forward range because of the constructor Arrows::Arrows

Return: an Arrow class for plotting

Function that constructs an Arrow. This will automatically derive correct types from the data-ranges and converts them into an optional_ptr that may or may not be the owner of the data.

function vector

template <PtrOrMoved U1,
PtrOrMoved U2,
PtrOrMoved U3,
PtrOrMoved U4>
inline auto vector(
    U1 && x1,
    U2 && y1,
    U3 && x2,
    U4 && y2
)

helper constructor function to construct vectors, where all coordinates are absolute to the graphs origin.

Parameters:

  • x1y1 The start coordinates of the Arrow
  • x2y2 The end coordinates of the Arrow (absolute to the graphs origin)

Template Parameters:

  • U1U2U3U4 Can either be:

  • a pointer to data (The Arrow will not own the data, aka. not deconstruct it) or

  • data that is moved (The Arrow will own the data, aka. destruct it) Further the datatype has to be a forward range because of the constructor Arrows::Arrows

Return: an Arrow class for plotting

Alias of arrows(U1&& x1, U2&& y1, U3&& x2, U4&& y2). Function that constructs vectors where all coordinates are absolute to the graphs origin. This will automatically derive correct types from the data-ranges and converts them into an optional_ptr that may or may not be the owner of the data.

function quiver

template <PtrOrMoved U1,
PtrOrMoved U2,
PtrOrMoved U3,
PtrOrMoved U4>
inline auto quiver(
    U1 && x,
    U2 && y,
    U3 && u,
    U4 && v
)

helper constructor function to construct quivers (arrows), [x, y] are absolute starting positions and [u, v] are relative to the start of the arrow [x, y].

Parameters:

  • xy The start coordinates of the Arrow
  • uv The end coordinates of the Arrow (relative to the arrows start [x, y])

Template Parameters:

  • U1U2U3U4 Can either be:

  • a pointer to data (The Arrow will not own the data, aka. not deconstruct it) or

  • data that is moved (The Arrow will own the data, aka. destruct it) Further the datatype has to be a forward range because of the constructor Arrows::Arrows

Return: an Arrow class for plotting

equivalent of calling arrows(x, y, u, v).dataRelation(DataRelation::relative). Function that constructs vectors where all [u, v] are relative to the arrows start [x, y]. This will automatically derive correct types from the data-ranges and converts them into an optional_ptr that may or may not be the owner of the data.

function boxes

template <PtrOrMoved U1,
PtrOrMoved U2>
inline auto boxes(
    U1 && x,
    U2 && y
)

function boxes

template <PtrOrMoved U2>
inline auto boxes(
    U2 && y
)

function boxplot

template <PtrOrMoved U1,
PtrOrMoved U2>
auto boxplot(
    const U1 & x_scalar,
    U2 && y_range
)

function boxplot

template <PtrOrMoved U2>
auto boxplot(
    U2 && y_range
)

function circle

inline Circle circle(
    float x,
    float y,
    float radius =1.0f,
    float startAngle =0.0f,
    float endAngle =360.0f
)

function operator+

Color operator+(
    const Color & l,
    const Color & r
)

function operator-

Color operator-(
    const Color & l,
    const Color & r
)

function operator*

Color operator*(
    const Color & l,
    const Color & r
)

function operator*

Color operator*(
    const Color & l,
    const float & r
)

function operator*

Color operator*(
    const float & l,
    const Color & r
)

function blend

Color blend(
    const Color & a,
    const Color & b,
    const float & t
)

function map

template <size_t N>
Color map(
    const float & v,
    const std::array< Color, N > & color_map
)

function filledcurves

template <PtrOrMoved U1,
PtrOrMoved U2,
PtrOrMoved U3>
auto filledcurves(
    U1 && x,
    U2 && y1,
    U3 && y2
)

function filledcurves

template <PtrOrMoved U2,
PtrOrMoved U3>
auto filledcurves(
    U2 && y1,
    U3 && y2
)

function heatmap

template <PtrOrMoved U1>
auto heatmap(
    U1 && matrix,
    size_t rows,
    size_t columns,
    std::function< double(const remove_ptr_t< std::remove_reference_t< U1 > > &, size_t, size_t)> at,
    Text title =""
)

function heatmap

template <MatrixLike U1>
auto heatmap(
    U1 && matrix
)

function heatmap

template <MatrixLike U1>
auto heatmap(
    U1 * matrix
)

function heatmap

template <class T ,
size_t ROWS,
size_t COLS>
auto heatmap(
    const T(*) array[ROWS][COLS]
)

function to_string

std::string_view to_string(
    ImageFileType filetype
)

function image_filetype_from_filename

ImageFileType image_filetype_from_filename(
    std::string_view filename
)

function impulses

template <PtrOrMoved U1,
PtrOrMoved U2>
auto impulses(
    U1 && x,
    U2 && y
)

function impulses

template <PtrOrMoved U2>
auto impulses(
    U2 && y
)

function line

template <PtrOrMoved Ux,
PtrOrMoved Uy>
auto line(
    Ux && x,
    Uy && y
)

Construction helper function to create a Line instance with x- and y-coordinate ranges.

Parameters:

  • x : [PtrOrMoved] - The x-coordinate data. Can be passed by pointer &x or moved std::move(x). Also has to satisfy std::ranges::forward_range
  • y : [PtrOrMoved] - The y-coordinate data. can be passed by pointer &x or moved std::move(x). Also has to satisfy std::ranges::forward_range

Return: A Line instance.

function line

template <PtrOrMoved Uy>
auto line(
    Uy && y
)

Construction helper function to create a Line instance with x and y coordinate ranges.

Parameters:

  • y : [PtrOrMoved] - The y-coordinate data. can be passed by pointer &x or moved std::move(x). Also has to satisfy std::ranges::forward_range

Return: A Line instance.

function to_command

std::string_view to_command(
    LineType dt
)

function to_file_ending

std::string_view to_file_ending(
    OutputFileType t
)

function to_terminal

TerminalType to_terminal(
    OutputFileType t
)

function filetype_from_filename

OutputFileType filetype_from_filename(
    std::string_view filename
)

function piechart

template <PtrOrMoved U1,
class U2 >
auto piechart(
    U1 && names,
    const U2 & values
)

function piechart

template <PtrOrMoved U1,
class U2 >
auto piechart(
    U1 && names,
    const U2 * values
)

function piechart

template <PtrOrMoved U2>
auto piechart(
    const U2 & values
)

function piechart

template <PtrOrMoved U2>
auto piechart(
    const U2 * values
)

function points

template <PtrOrMoved U1,
PtrOrMoved U2>
auto points(
    U1 && x,
    U2 && y
)

Construction helper function to create a Plot instance with x- and y-coordinate ranges.

Parameters:

  • x : [PtrOrMoved] - The x-coordinate data. Can be passed by pointer &x or moved std::move(x). Also has to satisfy std::ranges::forward_range
  • y : [PtrOrMoved] - The y-coordinate data. can be passed by pointer &x or moved std::move(x). Also has to satisfy std::ranges::forward_range

Return: A Points instance.

function scatter

template <PtrOrMoved U1,
PtrOrMoved U2>
auto scatter(
    U1 && x,
    U2 && y
)

Construction helper function to create a Plot instance with x- and y-coordinate ranges.

Parameters:

  • x : [PtrOrMoved] - The x-coordinate data. Can be passed by pointer &x or moved std::move(x). Also has to satisfy std::ranges::forward_range
  • y : [PtrOrMoved] - The y-coordinate data. can be passed by pointer &x or moved std::move(x). Also has to satisfy std::ranges::forward_range

Return: A Points instance.

Wrapper to for the function points(U1&& x, U2&& y), to provide another common name used for this kind of plots.

function points

template <PtrOrMoved U2>
auto points(
    U2 && y
)

Construction helper function to create a Plot instance with x- and y-coordinate ranges.

Parameters:

  • y : [PtrOrMoved] - The y-coordinate data. can be passed by pointer &x or moved std::move(x). Also has to satisfy std::ranges::forward_range

Return: A Points instance.

function scatter

template <PtrOrMoved U1,
PtrOrMoved U2>
auto scatter(
    U2 && y
)

Construction helper function to create a Plot instance with x- and y-coordinate ranges.

Parameters:

  • y : [PtrOrMoved] - The y-coordinate data. can be passed by pointer &x or moved std::move(x). Also has to satisfy std::ranges::forward_range

Return: A Points instance.

Wrapper to for the function points(U2&& y), to provide another common name used for this kind of plots.

function steps

template <PtrOrMoved U1,
PtrOrMoved U2>
auto steps(
    U1 && x,
    U2 && y
)

function steps

template <PtrOrMoved U2>
auto steps(
    U2 && y
)

function to_command

std::string_view to_command(
    TerminalType t
)

function operator<<

std::ostream & operator<<(
    std::ostream & stream,
    const Text & text
)

function xerror

template <PtrOrMoved U1,
PtrOrMoved U2,
PtrOrMoved U3>
auto xerror(
    U1 && x,
    U2 && y,
    U3 && xerr
)

function xyerror

template <PtrOrMoved U1,
PtrOrMoved U2,
PtrOrMoved U3,
PtrOrMoved U4>
auto xyerror(
    U1 && x,
    U2 && y,
    U3 && xerr,
    U4 && yerr
)

function yerror

template <PtrOrMoved U1,
PtrOrMoved U2,
PtrOrMoved U3>
auto yerror(
    U1 && x,
    U2 && y,
    U3 && yerr
)

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