11#include <matplot/matplot.h>
23void draw_xy(
const Eigen::VectorXd& x,
const Eigen::VectorXd& y);
35template <
typename FunctionType>
36void drawFunction(FunctionType&& f, std::pair<double, double>&& xRange,
int eValuationPoints = 100) {
37 std::vector<double> x = matplot::linspace(xRange.first, xRange.second, eValuationPoints);
38 std::vector<double> y = matplot::transform(x, [&f](
auto xL) {
return f(xL); });
39 matplot::plot(x, y,
"-o");
40 matplot::hold(matplot::on);
Definition: matplothelper.hh:14
void draw_xy(const Eigen::VectorXd &x, const Eigen::VectorXd &y)
Draw a 2D plot with given x and y vectors.
void drawFunction(FunctionType &&f, std::pair< double, double > &&xRange, int eValuationPoints=100)
Draw the plot of a mathematical function.
Definition: matplothelper.hh:36