forked from alandefreitas/matplotplusplus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot3_9.cpp
More file actions
30 lines (23 loc) · 716 Bytes
/
plot3_9.cpp
File metadata and controls
30 lines (23 loc) · 716 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
29
30
#include <cmath>
#include <matplot/matplot.h>
#include <random>
int main() {
using namespace matplot;
std::default_random_engine g(0);
std::uniform_real_distribution<double> d;
std::vector<double> x(10);
std::generate(x.begin(), x.end(), [&]() { return d(g); });
std::vector<double> y(10);
std::generate(y.begin(), y.end(), [&]() { return d(g); });
std::uniform_real_distribution<double> d2(0, 90);
std::vector<double> z(10);
std::generate(z.begin(), z.end(), [&]() { return d2(g); });
auto p = plot3(x, y, z, "o");
p->parent()->x_axis().tick_label_format("s");
xlabel("X");
ylabel("Y");
zlabel("Duration");
grid(on);
show();
return 0;
}