Austin Schuh | ab802d5 | 2020-07-03 18:11:11 -0700 | [diff] [blame^] | 1 | #include "../matplotlibcpp.h" |
2 | |||||
3 | namespace plt = matplotlibcpp; | ||||
4 | |||||
5 | int main() | ||||
6 | { | ||||
7 | // u and v are respectively the x and y components of the arrows we're plotting | ||||
8 | std::vector<int> x, y, u, v; | ||||
9 | for (int i = -5; i <= 5; i++) { | ||||
10 | for (int j = -5; j <= 5; j++) { | ||||
11 | x.push_back(i); | ||||
12 | u.push_back(-i); | ||||
13 | y.push_back(j); | ||||
14 | v.push_back(-j); | ||||
15 | } | ||||
16 | } | ||||
17 | |||||
18 | plt::quiver(x, y, u, v); | ||||
19 | plt::show(); | ||||
20 | } |