Got the dynamic re-scaling working ok now with Uwe's help.
Qt Code:
  1. const QwtScaleDiv &scaleDiv = axisScaleDiv(QwtPlot::xTop);
  2. const double center = (scaleDiv.lowerBound() + scaleDiv.range() / 2) + diff * 2;
  3. const double width_2 = scaleDiv.range() / 2 ;
  4. QwtPlot::setAxisScale(QwtPlot::xTop, center - width_2, center + width_2, 10000);
  5. setAxisScaleDraw(QwtPlot::xTop, new NewScaleDraw());
  6. replot();
To copy to clipboard, switch view to plain text mode 
Scale shows as 10 major divisions with 4 minor divisions - good so far.
But, the grid has 6 major divisions with 3 minor divisions - not so good. Need it to line up with the scale.
Here is how the grid was created
Qt Code:
  1. grid->enableX(true);
  2. grid->enableY(true);
  3. grid->enableXMin(true);
  4. grid->enableYMin(false);
  5.  
  6. QPen* majPen = new QPen;
  7. majPen->setWidth(1);
  8. majPen->setStyle(Qt::SolidLine);
  9.  
  10. QColor majColor;
  11. majColor.setNamedColor("white");
  12. majPen->setColor(majColor);
  13.  
  14. QPen* minPen = new QPen;
  15. minPen->setWidth(1);
  16. minPen->setStyle(Qt::DotLine);
  17.  
  18. QColor minColor;
  19. minColor.setNamedColor("grey");
  20. minPen->setColor(minColor);
  21.  
  22. grid->setMajorPen(*majPen);
  23. grid->setMinorPen(*minPen);
  24.  
  25. grid->attach(this);
To copy to clipboard, switch view to plain text mode 
So what am I doing wrong that the grid doesn't line up with the scale?
Thanks for any assistance.