| 2 | #include <matplot/matplot.h> |
| 3 | |
| 4 | int main() { |
| 5 | using namespace matplot; |
| 6 | |
| 7 | std::vector<double> x = linspace(0, 2 * pi); |
| 8 | std::vector<double> y1 = transform(x, [](auto x) { return sin(x); }); |
| 9 | std::vector<double> y2 = transform(x, [](auto x) { return sin(x - 0.25); }); |
| 10 | std::vector<double> y3 = transform(x, [](auto x) { return sin(x - 0.5); }); |
| 11 | plot(x, y1, "g", x, y2, "b--o", x, y3, "c*"); |
| 12 | |
| 13 | show(); |
| 14 | return 0; |
| 15 | } |