Index: trunk/BNC/src/rinex/graphwin.cpp
===================================================================
--- trunk/BNC/src/rinex/graphwin.cpp	(revision 4576)
+++ trunk/BNC/src/rinex/graphwin.cpp	(revision 4577)
@@ -42,4 +42,5 @@
 #include "qwt_scale_widget.h"
 #include <qwt_scale_engine.h>
+#include <qwt_plot_renderer.h>
 
 using namespace std;
@@ -159,11 +160,10 @@
 // Save the Widget as PNG Files
 ////////////////////////////////////////////////////////////////////////////
-void t_graphWin::savePNG(const QString& dirName, QByteArray ext) {
+void t_graphWin::savePNG(const QString& dirName, QByteArray ext,
+                         QwtPlot* plot) {
   if (dirName.isEmpty()) {
     return;
   }
-  QImage image(_canvas->size(), QImage::Format_RGB32);
-  QPainter painter(&image);
-  _canvas->render(&painter);
+
   QDir dir(dirName);
   QFileInfo fileInfo(_fileName);
@@ -173,4 +173,16 @@
   QString fileName = dir.path() + QDir::separator()
                    + fileInfo.completeBaseName() + ext;
-  image.save(fileName,"PNG");
+
+  if (plot) {        
+    QwtPlotRenderer renderer;
+    renderer.setDiscardFlag(QwtPlotRenderer::DiscardBackground, false);
+    renderer.setLayoutFlag(QwtPlotRenderer::KeepFrames, true);
+    renderer.renderDocument(plot, fileName, QSizeF(300, 200), 85);
+  }
+  else {
+    QImage image(_canvas->size(), QImage::Format_RGB32);
+    QPainter painter(&image);
+    _canvas->render(&painter);
+    image.save(fileName,"PNG");
+  }
 }
Index: trunk/BNC/src/rinex/graphwin.h
===================================================================
--- trunk/BNC/src/rinex/graphwin.h	(revision 4576)
+++ trunk/BNC/src/rinex/graphwin.h	(revision 4577)
@@ -29,4 +29,5 @@
 #include <QtGui>
 #include <qwt_color_map.h>
+#include <qwt_plot.h>
 
 class QwtScaleWidget;
@@ -57,5 +58,5 @@
   ~t_graphWin();
 
-  void savePNG(const QString& dirName, QByteArray ext);
+  void savePNG(const QString& dirName, QByteArray ext, QwtPlot* plot);
 
  signals:
Index: trunk/BNC/src/rinex/reqcanalyze.cpp
===================================================================
--- trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 4576)
+++ trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 4577)
@@ -42,8 +42,4 @@
 #include <iomanip>
 
-#include <qwt_plot.h>
-#include <qwt_plot_curve.h>
-#include <qwt_symbol.h>
-
 #include "reqcanalyze.h"
 #include "bncapp.h"
@@ -54,4 +50,5 @@
 #include "graphwin.h"
 #include "polarplot.h"
+#include "availplot.h"
 
 using namespace std;
@@ -169,5 +166,5 @@
     if (!dirName.isEmpty()) {
       QByteArray ext = scaleTitle.isEmpty() ? "_SNR.png" : "_MP.png";
-      graphWin->savePNG(dirName, ext);
+      graphWin->savePNG(dirName, ext, 0);
     }
   }
@@ -516,28 +513,5 @@
   if (dynamic_cast<bncApp*>(qApp)->GUIenabled()) {
 
-    QwtPlot* plot = new QwtPlot();
-
-    int iC = 0;
-    QMapIterator<QString, QVector<int> > it(*prnAvail);
-    while (it.hasNext()) {
-      it.next();
-      ++iC;
-      const QString&      prn    = it.key();
-      const QVector<int>& epochs = it.value();
-
-      QVector<QPointF> samples;
-      for (int ii = 0; ii < epochs.size(); ii++) {
-        samples << QPointF(epochs[ii], iC);
-      }
-
-      QwtPlotCurve* curve = new QwtPlotCurve(prn);
-      curve->setStyle( QwtPlotCurve::NoCurve );
-      QwtSymbol* symbol = new QwtSymbol( QwtSymbol::XCross );
-      symbol->setSize( 4 );
-      curve->setSymbol( symbol );
-      curve->setLegendAttribute( QwtPlotCurve::LegendShowSymbol );
-      curve->setSamples(samples);
-      curve->attach(plot);
-    }
+    t_availPlot* plot = new t_availPlot(0, prnAvail);
 
     QVector<QWidget*> plots;
@@ -550,6 +524,6 @@
     if (!dirName.isEmpty()) {
       QByteArray ext = "_AVAIL.png";
-      graphWin->savePNG(dirName, ext);
-    }
-  }
-}
+      graphWin->savePNG(dirName, ext, plot);
+    }
+  }
+}
