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

Function main

examples/line_plot/plot/plot_1.cpp:4–17  ·  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 std::vector<double> x = linspace(0, 2 * pi);
7 std::vector<double> y = transform(x, [](auto x) { return sin(x); });
8
9 plot(x, y, "-o");
10 hold(on);
11 plot(x, transform(y, [](auto y) { return -y; }), "--xr");
12 plot(x, transform(x, [](auto x) { return x / pi - 1.; }), "-:gs");
13 plot({1.0, 0.7, 0.4, 0.0, -0.4, -0.7, -1}, "k");
14
15 show();
16 return 0;
17}

Callers

nothing calls this directly

Calls 5

linspaceFunction · 0.85
transformFunction · 0.85
holdFunction · 0.85
showFunction · 0.85
plotFunction · 0.50

Tested by

no test coverage detected