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

Function main

examples/line_plot/area/area_3.cpp:3–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include <matplot/matplot.h>
2
3int main() {
4 using namespace matplot;
5
6 std::vector<std::vector<double>> Y = {
7 {1, 3, 1, 2}, {5, 2, 5, 6}, {3, 7, 3, 1}};
8
9 auto f = gcf();
10 f->width(f->width() * 2);
11
12 subplot(1, 2, 0);
13 auto h1 = area(Y, -4.);
14 h1[0]->line_style(":");
15 h1[1]->line_style(":");
16 h1[2]->line_style(":");
17 h1[0]->face_color({0, 0, 0.25, 0.25});
18 h1[1]->face_color({0, 0, 0.5, 0.5});
19 h1[2]->face_color({0, 0, 0.75, 0.75});
20 title("Stacked");
21
22 subplot(1, 2, 1);
23 auto h2 = area(Y, -4, false);
24 h2[0]->line_style(":");
25 h2[1]->line_style(":");
26 h2[2]->line_style(":");
27 h2[0]->face_color({0.2f, 0.f, 0.25f, 0.25f});
28 h2[1]->face_color({0.2f, 0.f, 0.5f, 0.5f});
29 h2[2]->face_color({0.2f, 0.f, 0.75f, 0.75f});
30 title("Not stacked");
31
32 show();
33 return 0;
34}

Callers

nothing calls this directly

Calls 7

gcfFunction · 0.85
subplotFunction · 0.85
showFunction · 0.85
line_styleMethod · 0.80
areaFunction · 0.50
titleFunction · 0.50
widthMethod · 0.45

Tested by

no test coverage detected