matplotlib-cpp
matplotlib-cpp copied to clipboard
how to use colorbar?
Thanks a lot for your work, I'm new to c++ and ran into this problem. When I draw a heat map, using colorbar, I get an error like this: what(): Must call colorbar with PyObject* returned from an image, contour, surface, etc.
this is my code:
matplotlibcpp::imshow((float*)a,20,27,1); matplotlibcpp::colorbar(); matplotlibcpp::show();
solved
PyObject* mat;
matplotlibcpp::imshow((float*)a,20,27,1,{},&mat);
matplotlibcpp::colorbar(mat);