+ const PlotFile& rPlot = GetDocument()->getPlotFile();\r
+ const int iNColumns = rPlot.getNumColumns();\r
+ const int iNRecords = rPlot.getNumRecords();\r
+\r
+ if (iNColumns > 0 && iNRecords > 0) {\r
+ int xsize, ysize;\r
+ m_canvas->GetClientSize (&xsize, &ysize);\r
+ SGPDriver driver (dc, xsize, ysize);\r
+ SGP sgp (driver);\r
+ const PlotFile& rPhantom = GetDocument()->getPlotFile();\r
+ EZPlot plot (sgp);\r
+\r
+ if (! rPlot.getTitle().empty()) {\r
+ std::string s("title ");\r
+ s += rPlot.getTitle();\r
+ plot.ezset (s);\r
+ }\r
+ if (! rPlot.getXLabel().empty()) {\r
+ std::string s("xlabel ");\r
+ s += rPlot.getXLabel();\r
+ plot.ezset (s);\r
+ }\r
+ if (! rPlot.getYLabel().empty()) {\r
+ std::string s("ylabel ");\r
+ s += rPlot.getYLabel();\r
+ plot.ezset (s);\r
+ }\r
+\r
+ plot.ezset("box");\r
+ plot.ezset("grid");\r
+\r
+ double* pdXaxis = new double [iNRecords];\r
+ rPlot.getColumn (0, pdXaxis);\r
+\r
+ double* pdY = new double [iNRecords];\r
+ for (int iCol = 1; iCol < iNColumns; iCol++) {\r
+ rPlot.getColumn (iCol, pdY);\r
+ plot.addCurve (pdXaxis, pdY, iNRecords);\r
+ }\r
+\r
+ delete pdXaxis;\r
+ delete pdY;\r
+\r
+ plot.plot();\r
+ }\r