- if (minVal < v[xCursor][i])\r
- minVal = v[xCursor][i];\r
- else if (maxVal > v[xCursor][i])\r
- maxVal = v[xCursor][i];\r
- pVec[i] = v[xCursor][i];\r
+ double y = v[xCursor][i];\r
+ if (minVal < y)\r
+ minVal = y;\r
+ else if (maxVal > y)\r
+ maxVal = y;\r
+ pX[i] = i;\r
+ pY[i] = y;\r
+ }\r
+ PlotFileDocument* pPlotDoc = dynamic_cast<PlotFileDocument*>(theApp->getDocManager()->CreateDocument("untitled.plt", wxDOC_SILENT));\r
+ if (! pPlotDoc) {\r
+ sys_error (ERR_SEVERE, "Internal error: unable to create Plot file");\r
+ } else {\r
+ PlotFile& rPlot = pPlotDoc->getPlotFile();\r
+ std::ostringstream title;\r
+ title << "Column " << xCursor;\r
+ rPlot.setTitle(title.str());\r
+ rPlot.setXLabel("Row");\r
+ rPlot.setYLabel("Pixel Value");\r
+ rPlot.setCurveSize (2, nx);\r
+ rPlot.addColumn (0, pX);\r
+ rPlot.addColumn (1, pY);\r