matplotplusplus icon indicating copy to clipboard operation
matplotplusplus copied to clipboard

Hope to add more types as input of coordinates

Open PangYanze opened this issue 1 month ago • 0 comments

First of all, thanks for your efforts, which has brought great convenience to my project. However, I still encountered some minor problems. For example, when I use plot(x,y), the types supported by x/y seem not to be enough. For example, std::span and std::range added after C++20 are not supported. For example, I use the Eigen::Vector as X and Y, and I have to copy all the data into std::vector and then invoke the plot function. While if std::span is supported, I can:

Eigen::VectorXd x = Eigen::VectorXd::LinSpaced(1001, 1, 100);
Eigen::VectorXd y=2*x;
matplot::plot(
std::span<const double>(x.data(),x.size()),
std::span<const double>(y.data(), y.size())
);

Of course, this may not be the optimal solution, but I still hope to support more input types.

PangYanze avatar Oct 28 '25 08:10 PangYanze