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

Function main

examples/line_plot/plot/plot_9.cpp:4–24  ·  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(0, 3);
8 std::vector<double> y1 = transform(x, [](auto x) { return sin(5 * x); });
9 std::vector<double> y2 = transform(x, [](auto x) { return sin(15 * x); });
10
11 tiledlayout(2, 1);
12 auto ax1 = nexttile();
13 plot(ax1, x, y1);
14 title(ax1, "Top Plot");
15 ylabel(ax1, "sin(5x)");
16
17 auto ax2 = nexttile();
18 plot(ax2, x, y2);
19 title(ax2, "Bottom Plot");
20 ylabel(ax2, "sin(15x)");
21
22 show();
23 return 0;
24}

Callers

nothing calls this directly

Calls 8

linspaceFunction · 0.85
transformFunction · 0.85
tiledlayoutFunction · 0.85
nexttileFunction · 0.85
ylabelFunction · 0.85
showFunction · 0.85
plotFunction · 0.50
titleFunction · 0.50

Tested by

no test coverage detected