| 2 | #include <matplot/matplot.h> |
| 3 | |
| 4 | int main() { |
| 5 | using namespace matplot; |
| 6 | tiledlayout(1, 2); |
| 7 | |
| 8 | auto ax1 = nexttile(); |
| 9 | auto t = iota(0, pi / 20, 10 * pi); |
| 10 | auto xt1 = transform(t, [](auto t) { return sin(t); }); |
| 11 | auto yt1 = transform(t, [](auto t) { return cos(t); }); |
| 12 | plot3(ax1, xt1, yt1, t); |
| 13 | title(ax1, "Helix with 5 Turns"); |
| 14 | |
| 15 | auto ax2 = nexttile(); |
| 16 | t = iota(0, pi / 40, 10 * pi); |
| 17 | auto xt2 = transform(t, [](auto t) { return sin(2 * t); }); |
| 18 | auto yt2 = transform(t, [](auto t) { return cos(2 * t); }); |
| 19 | plot3(ax2, xt2, yt2, t); |
| 20 | ax2->box(false); |
| 21 | title(ax2, "Helix with 10 Turns"); |
| 22 | |
| 23 | show(); |
| 24 | return 0; |
| 25 | } |