Incorrect plot when arguments are blocks of an Eigen::Matrix
If I declare an
Eigen::Matrix _2D_data; /* The initialization does not matter. The first row holds the x-coordinates, and the second row holds the y- coordinates. */
and I want to call
plt::plot(_2D_data.row(1), _2D_data.row(2));
the resulting plot will not be correct. Around 50% of the points will have their coordinates reversed (the x-coordinates will become y-coordinates and vice-versa).
To correctly plot, I have to write:
Eigen::VectorX x_coords{ _2D_data.row(0) }; Eigen::VectorX y_coords{ _2D_data.row(1) };
plt::plot(x_coords, y_coords);
Thanks for the otherwise great library!
Hi @Lavinius, thanks for reporting this! Feel free to submit a PR to address this issue, I didn't touch the code in a long time and it would probably take me a bit longer than you 😉