Пример цвета карта:

Здесь я включил большинство библиотек
Код: Выделить всё
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define NSIZE 101
Код: Выделить всё
// Function to read data from a text file
std::vector readData(const std::string& filename) {
std::vector data;
std::ifstream file(filename.c_str());
std::string line;
if (!file.is_open()) {
std::cerr sdev("xwin");
pls->init();
pls->env(0.0, rows, 0.0, col, 1, -1);
pls->lab("X", "Y", "Colour Map Example");
PLFLT **z = new PLFLT*[col];
for (int i = 0; i < col; ++i) {
z[i] = new PLFLT[rows];
for (int j = 0; j < rows; ++j) {
z[i][j] = data[i][j];
}
}
pls->scmap1l(true, 256, NULL, NULL, NULL, NULL);
PLFLT xmin = 0.0, xmax = static_cast
(rows - 1);
PLFLT ymin = 0.0, ymax = static_cast(col - 1);
PLFLT zmin = **std::min(z, z + (rows * col));
PLFLT zmax = **std::max(z, z + (rows * col));
pls->col0(1);
pls->imagefr(z, rows, col, xmin, xmax, ymin, ymax, zmin, zmax, 0, 0, 0, 0);
}
Код: Выделить всё
int main( int argc, char *argv[] )
{
std::vector data;
data = readData("Test.txt");
createColourMap(data);
Here is where the error pops up
return 0;
}

Подробнее здесь: https://stackoverflow.com/questions/787 ... ext-file-b