forked from alandefreitas/matplotplusplus
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfplot3_5.cpp
More file actions
28 lines (23 loc) 路 766 Bytes
/
Copy pathfplot3_5.cpp
File metadata and controls
28 lines (23 loc) 路 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <cmath>
#include <matplot/matplot.h>
int main() {
using namespace matplot;
auto xt = [](double t) { return t; };
auto yt = [](double t) { return t/2.; };
auto zt = [](double t) { return sin(6.*t); };
fplot3(xt, yt, zt, std::array<double, 2>{-2*pi, 2*pi})->mesh_density(300).line_width(1);
title("x=t, y=t/2, z=sin(6t) for -2蟺<t<2蟺");
xlabel("x");
ylabel("y");
view(52.5, 30);
box(on);
xrange({-2*pi,+2*pi});
yrange({-pi,+pi});
auto ax = gca();
ax->xticks(iota(-2*pi,pi/2,2*pi));
ax->x_axis().ticklabels({"-2蟺","-3蟺/2","-蟺","-蟺/2","0","蟺/2","蟺","3蟺/2","蟺"});
ax->yticks(iota(-pi,pi/2,pi));
ax->y_axis().ticklabels({"-蟺","-蟺/2","0","蟺/2","蟺"});
wait();
return 0;
}