This works:

diff Code:
  1. ===================================================================
  2. --- plotmatrix.cpp (revision 1452)
  3. +++ plotmatrix.cpp (working copy)
  4. @@ -47,6 +47,9 @@
  5. QwtPlot *plot = new QwtPlot( this );
  6. layout->addWidget( plot, row, col );
  7.  
  8. + if (row == 0 && col == 0) plot->axisWidget (QwtPlot::yLeft)->setTitle ("Line 1");
  9. + if (row == 1 && col == 0) plot->axisWidget (QwtPlot::yLeft)->setTitle ("Line 1<BR>Units");
  10. +
  11. for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
  12. {
  13. connect( plot->axisWidget( axis ),
  14. @@ -276,7 +279,9 @@
  15. QwtScaleDraw *sd = scaleWidget->scaleDraw();
  16. sd->setMinimumExtent( 0.0 );
  17.  
  18. - const double extent = sd->extent( scaleWidget->font() );
  19. + double extent = sd->extent( scaleWidget->font() );
  20. + if( !scaleWidget->title().isEmpty())
  21. + extent += scaleWidget->title().textSize().height();
  22. if ( extent > maxExtent )
  23. maxExtent = extent;
  24. }
  25. @@ -287,7 +292,11 @@
  26. if ( p )
  27. {
  28. QwtScaleWidget *scaleWidget = p->axisWidget( axis );
  29. - scaleWidget->scaleDraw()->setMinimumExtent( maxExtent );
  30. + double extent = maxExtent;
  31. + if(!scaleWidget->title().text().isEmpty()) {
  32. + extent -= scaleWidget->title().textSize().height();
  33. + }
  34. + scaleWidget->scaleDraw()->setMinimumExtent( extent );
  35. }
  36. }
  37. }
To copy to clipboard, switch view to plain text mode 

Of course in a general case you have to take into account the font of the title, which I ignored assuming it is the default one. You should also consider the spacing between the title and the scale (you can see there is an "off by 1" (or 2) error in the result of my patch).