Closed
Description
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!
Metadata
Metadata
Assignees
Labels
No labels