//void 2dplot( { ifstream file("Line scan spectra 2 open aperture.txt"); if (!file.good()) { printf("Please check the filename. The one specified (%s) doesn't exist.", file); return; } int row = 91; int column = 5360 / 4; int max = 0; int value; TCanvas* c = new TCanvas("c","Contour List",0,0,600,600); c->SetRightMargin(0.15); c->SetTopMargin(0.15); gStyle->SetPalette(1); gStyle->SetOptStat(0); gStyle->SetTitleW(0.99); gStyle->SetTitleH(0.08); TH2D *histo = new TH2D("test", "2 point test data", column, 0, column-1, row, 0, row-1); histo->SetEntries(1); for (int i = 0; i < row; i++) { for (int j = 0; j < column; j++) { file >> value; histo->SetBinContent(j+1, row - i, value); if (value > max) max = value; } } Double_t contours[104]; for (int i = 0; i < 104; i++) { contours[i] = (float)max * i / 104; } histo->SetContour(104, contours); histo->Draw("CONT Z LIST"); // c->Update(); }