We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab4fda1 commit 558a3ecCopy full SHA for 558a3ec
Plotting/imageplot.h
@@ -44,16 +44,10 @@ class QCPDataColorMap : public QCPColorMap
44
// key is x, value is y?
45
std::vector<double> output(data()->valueSize()*data()->keySize());
46
47
- auto r1 = data()->keyRange();
48
- auto r2 = data()->valueRange();
49
-
50
- int counter = 0;
51
- for (int i = r2.upper; i >= r2.lower; --i)
52
- for (int j = r1.lower; j < r1.upper; ++j)
53
- {
54
- output[ counter ] = data()->data(j, i);
55
- ++counter;
56
- }
+ // the odd indexing is because we need to export the image 'upside down'
+ for (int i = 0; i < data()->valueSize(); ++i)
+ for (int j = 0; j < data()->keySize(); ++j)
+ output[ i*data()->keySize() + j ] = data()->cell(j, data()->valueSize()-1-i);
57
58
return output;
59
}
0 commit comments