blob: ea3c3ecab87c2005555b0645f2eeca87aa672194 [file] [log] [blame]
Austin Schuhab802d52020-07-03 18:11:11 -07001#include "../matplotlibcpp.h"
2
3namespace plt = matplotlibcpp;
4
5int 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}