Austin Schuh | 6c8ec4c | 2018-01-23 11:18:57 -0800 | [diff] [blame] | 1 | #include "../matplotlibcpp.h" |
2 | #include <vector> | ||||
3 | #include <cmath> | ||||
4 | |||||
5 | namespace plt = matplotlibcpp; | ||||
6 | |||||
7 | int main() { | ||||
8 | std::vector<double> t(1000); | ||||
9 | std::vector<double> x(t.size()); | ||||
10 | |||||
11 | for(size_t i = 0; i < t.size(); i++) { | ||||
12 | t[i] = i / 100.0; | ||||
13 | x[i] = sin(2.0 * M_PI * 1.0 * t[i]); | ||||
14 | } | ||||
15 | |||||
16 | plt::xkcd(); | ||||
17 | plt::plot(t, x); | ||||
18 | plt::title("AN ORDINARY SIN WAVE"); | ||||
19 | plt::show(); | ||||
20 | } | ||||
21 |