I want to draw a heatmap, I have a 2d array and I followed this answer : https://stackoverflow.com/a/32459287/2370139 Except that I use gnuplot within c++ and I removed "nonuniform" since the first row and columns are regular values, not ticks.
Gnuplot gp;
gp << "set autoscale xfix \n";
gp << "set autoscale yfix \n";
gp << "set autoscale cbfix \n";
gp << "plot '-' matrix with image notitle\n";
gp.send2d(pmat);
gp.flush();
pmat is a 2d array of size 50*50. It is filled with float values between 0 and 1. It does plot a perfectly white grid, what could the issue be ?
NOTE : The above commands work fine when used in a normal gnuplot terminal with a text file like
0.5 0.3 0.3
0.2 0.4 0.6
0.2 0.8 1
so the problem has to come from my usage of the C++ api