4#include <matplot/matplot.h>
6#include "boost/multi_array.hpp"
7#include "boost/array.hpp"
18 std::vector<double> x = matplot::linspace(0, 0, arr.shape()[0]);
19 std::vector<double> y = matplot::linspace(00, 0, arr.shape()[1]);
20 matplot::vector_2d result = std::get<0>(matplot::meshgrid(x, y));
22 for (
size_t i = 0; i < arr.shape()[0]; i++)
24 for (
size_t j = 0; j < arr.shape()[1]; j++)
26 result[i][j] = arr[i][j];
matplot::vector_2d convert_to_matplot(const boost::multi_array< double, 2 > &arr)
Convert a 2D boost::multi_array to a matplot::vector_2d.
Custom implementation of numpy in C++.