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

Function main

examples/annotations/rectangle/rectangle_5.cpp:4–22  ·  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 using namespace std;
7
8 vector<double> x = {0, 8, 8, 0};
9 vector<double> y = {0, 0, 4, 4};
10 polygon(x, y, "g");
11 rectangle(0, 0, 2, 4, 0)->fill(true).color("red");
12 rectangle(3, 0, 2, 4, 1)->fill(true).color("magenta");
13 rectangle(6, 0, 2, 4, 0.5)->fill(true).color("yellow");
14 text(2, 2, "Curvature 0")->alignment(labels::alignment::right);
15 text(4, 2, "Curvature 1")->alignment(labels::alignment::center);
16 text(6, 2, "Curvature 0.5")->alignment(labels::alignment::left);
17 arrow(4, 2.2, 3, 3);
18 textarrow(6, 1, 8, 0, "Last corner");
19
20 show();
21 return 0;
22}

Callers

nothing calls this directly

Calls 9

rectangleFunction · 0.85
arrowFunction · 0.85
textarrowFunction · 0.85
showFunction · 0.85
alignmentMethod · 0.80
polygonFunction · 0.50
textFunction · 0.50
colorMethod · 0.45
fillMethod · 0.45

Tested by

no test coverage detected