11#include <matplot/matplot.h> 
   23  void draw_xy(
const Eigen::VectorXd& x, 
const Eigen::VectorXd& y);
 
   35  template <
typename FunctionType>
 
   36  void 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 x_) { 
return f(x_); });
 
   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