File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 6
6
* .obj
7
7
* .html
8
8
* .ruleset
9
- * .gif
9
+ * .gif
10
+ build /*
Original file line number Diff line number Diff line change 4
4
#include < random>
5
5
#include < numeric>
6
6
7
- #include < Eigen/Eigen/Core>
8
-
9
7
/*
10
8
* Uncomment seaborn imports in cppyplot_server.py for this example to work
11
9
*/
@@ -15,7 +13,6 @@ int main()
15
13
{
16
14
Cppyplot::cppyplot pyp;
17
15
18
- Eigen::Matrix<double , 5000 , 2 > mat;
19
16
std::vector<std::vector<double >> rand_mat (5000 , std::vector<double >(2 ));
20
17
std::random_device seed;
21
18
std::mt19937 gen (seed ());
@@ -28,7 +25,9 @@ int main()
28
25
{ elem = norm (gen); }
29
26
}
30
27
28
+ #ifdef EIGEN_AVAILABLE
31
29
// fill eigen matrix
30
+ Eigen::Matrix<double , 5000 , 2 > mat;
32
31
for (auto & row: mat.rowwise ())
33
32
{
34
33
for (auto & elem : row)
@@ -48,6 +47,7 @@ int main()
48
47
plt.title("Numpy type slicing on C++ Eigen matrix", fontsize=14)
49
48
plt.show(block=False)
50
49
)pyp" , _p (mat));
50
+ #endif
51
51
52
52
// Using 2D std-vector
53
53
pyp.raw (R"pyp(
@@ -58,7 +58,7 @@ int main()
58
58
plt.grid(True)
59
59
plt.xlabel("X", fontsize=12)
60
60
plt.ylabel("Y", fontsize=12)
61
- plt.title("Numpy type slicing on C++ 2D vector ", fontsize=14)
61
+ plt.title("2D distribution plotting with seaborn ", fontsize=14)
62
62
plt.show()
63
63
)pyp" , _p (rand_mat));
64
64
You can’t perform that action at this time.
0 commit comments