MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / main

Function main

examples/annotations/text/text_2.cpp:4–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <matplot/matplot.h>
3
4int main() {
5 using namespace matplot;
6
7 std::vector<double> x = linspace(-5, +5);
8 std::vector<double> y =
9 transform(x, [](auto x) { return pow(x, 3) - 12 * x; });
10 plot(x, y);
11
12 std::vector<double> xt = {-2, +2};
13 std::vector<double> yt = {16, -16};
14 std::string str = "dy/dx = 0";
15 text(xt, yt, str);
16
17 show();
18 return 0;
19}

Callers

nothing calls this directly

Calls 5

linspaceFunction · 0.85
transformFunction · 0.85
showFunction · 0.85
plotFunction · 0.50
textFunction · 0.50

Tested by

no test coverage detected