Plotting heatmap with Gnuplot in C++
#include <vector> #include <cmath> #include <boost/tuple/tuple.hpp> #include "gnuplot-iostream.h" int main() { float frame[4][4]; for (int n=0; n<4; n++) { for (int m=0; m<4; m++) { frame[n][m]=n+m; } } Gnuplot gp; gp << "unset key\n"; gp << "set pm3d\n"; gp << "set hidden3d\n"; gp << "set view map\n"; gp << "set xrange [ -0.500000 : 3.50000 ] \n"; gp << "set yrange [ -0.500000 : 3.50000 ] \n"; gp << "splot '-'\n"; gp.send2d(frame); gp.flush(); } This generates me an image: The problem is, that element "frame[0][0]" should be black in this color palette. And I suppose it is black, but the area