| 5 | #include <vector> |
| 6 | |
| 7 | int main() { |
| 8 | using namespace matplot; |
| 9 | for (size_t i = 0; i < 4; ++i) { |
| 10 | subplot(2, 2, i); |
| 11 | std::string equation = "cos(x**" + num2str(i + 1) + ") + " + num2str(i); |
| 12 | fplot(equation); |
| 13 | title(equation); |
| 14 | } |
| 15 | subplot(2, 2, 1, true); |
| 16 | fplot("sin(x)"); |
| 17 | title("sin(x)"); |
| 18 | show(); |
| 19 | return 0; |
| 20 | } |