| 2 | #include <matplot/matplot.h> |
| 3 | |
| 4 | int main() { |
| 5 | using namespace matplot; |
| 6 | |
| 7 | auto x = linspace(-5, +5); |
| 8 | auto y = transform(x, [](double x) { return pow(x, 3) - 12 * x; }); |
| 9 | plot(x, y); |
| 10 | auto t = text({-2, 2}, {16, -16}, "dy/dx=0"); |
| 11 | t->colors({.0, 1.}); |
| 12 | t->sizes({14, 10}); |
| 13 | gca()->colormap({{1, 0, 0}, {0, 0, 0}}); |
| 14 | |
| 15 | show(); |
| 16 | return 0; |
| 17 | } |