blob: fa41cfc46b83907e00672a6f115e95f8c238932f [file] [log] [blame]
Austin Schuhab802d52020-07-03 18:11:11 -07001#define _USE_MATH_DEFINES
2#include <cmath>
Austin Schuh6c8ec4c2018-01-23 11:18:57 -08003#include "../matplotlibcpp.h"
4#include <vector>
Austin Schuh6c8ec4c2018-01-23 11:18:57 -08005
6namespace plt = matplotlibcpp;
7
8int main() {
9 std::vector<double> t(1000);
10 std::vector<double> x(t.size());
11
12 for(size_t i = 0; i < t.size(); i++) {
13 t[i] = i / 100.0;
14 x[i] = sin(2.0 * M_PI * 1.0 * t[i]);
15 }
16
17 plt::xkcd();
18 plt::plot(t, x);
19 plt::title("AN ORDINARY SIN WAVE");
20 plt::show();
21}
22