-
-
Save leha-bot/13d4790cc76bb05dd8b376a1fdd6e7ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <matplot/matplot.h> | |
#include <cstddef> | |
#include <cmath> | |
#include <vector> | |
#include <cassert> | |
std::string get_filename(const std::string &prefix, const std::string &matr_name) | |
{ | |
return prefix + "_" + matr_name + ".png"; | |
} | |
void simplified_test_case(const std::string &prefix) | |
{ | |
// take one, plot | |
double some[] = {21, 54, 76, 33}; | |
matplot::title("Test plot"); | |
matplot::plot(std::vector<double>{std::begin(some), std::end(some)}); | |
matplot::save(get_filename(prefix, "stdvec_1d.png")); | |
auto matr_0 = std::vector<std::vector<double>> {{10,10,10,10},{10,10,10,10},{10,10,10,10},{10,10,10,10}}; | |
matplot::title("Test matrix (heatmap) 4x4, all tens"); | |
matplot::heatmap(matr_0); | |
matplot::save(get_filename(prefix, "test_heatmap_stdvec_2d_all_tens")); | |
} | |
int main() | |
{ | |
simplified_test_case("first_try"); | |
simplified_test_case("second_try"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment