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

Function main

examples/graphs/digraph/digraph_3.cpp:4–21  ·  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<std::pair<size_t, size_t>> edges = {
7 {0, 1}, {0, 2}, {0, 9}, {1, 3}, {1, 11}, {2, 3},
8 {2, 4}, {3, 5}, {4, 5}, {4, 6}, {5, 8}, {6, 7},
9 {6, 9}, {7, 8}, {7, 10}, {8, 11}, {9, 10}, {10, 11}};
10 auto g = digraph(edges);
11 g->marker("s");
12 g->node_color("red");
13 g->marker_size(7);
14 g->line_style("--");
15
16 g->x_data({2, 4, 1.5, 3.5, 1, 3, 1, 2.1, 3, 2, 3.1, 4});
17 g->y_data({3, 3, 3.5, 3.5, 4, 4, 2, 2, 2, 1, 1, 1});
18
19 show();
20 return 0;
21}

Callers

nothing calls this directly

Calls 5

showFunction · 0.85
line_styleMethod · 0.80
digraphFunction · 0.50
markerMethod · 0.45
marker_sizeMethod · 0.45

Tested by

no test coverage detected