| 2 | #include <matplot/matplot.h> |
| 3 | |
| 4 | int main() { |
| 5 | using namespace matplot; |
| 6 | |
| 7 | std::vector<double> x = linspace(0, 10, 150); |
| 8 | std::vector<double> y = transform(x, [](auto x) { return cos(5 * x); }); |
| 9 | plot(x, y)->color({0.f, 0.7f, 0.9f}); |
| 10 | title("2-D Line Plot"); |
| 11 | xlabel("x"); |
| 12 | ylabel("cos(5x)"); |
| 13 | |
| 14 | show(); |
| 15 | return 0; |
| 16 | } |