I want to get an axis like this:
1.jpg

The axis from 20-20K.
between 20 and 100, the step is 10
between 100-1K, the step is 100
between 1K-10K, the step is 1000
and 10K-20K, the step is 10k.

I copy some code from qwt example,like the following:
Qt Code:
  1. logSpace(frequency, 20000, 20,20000);
  2. ...
  3. currentCurve->setSamples(frequency, amplitude, 20000);
  4. ...
  5. #define qExp(x) ::exp(x)
  6. #define qAtan2(y, x) ::atan2(y, x)
  7.  
  8. static void logSpace( double *array, int size, double xmin, double xmax )
  9. {
  10. if ( ( xmin <= 0.0 ) || ( xmax <= 0.0 ) || ( size <= 0 ) )
  11. return;
  12.  
  13. const int imax = size - 1;
  14.  
  15. array[0] = xmin;
  16. array[imax] = xmax;
  17.  
  18. const double lxmin = log( xmin );
  19. const double lxmax = log( xmax );
  20. const double lstep = ( lxmax - lxmin ) / double( imax );
  21.  
  22. for ( int i = 1; i < imax; i++ )
  23. array[i] = qExp( lxmin + double( i ) * lstep );
  24. }
To copy to clipboard, switch view to plain text mode 

But I got the following display:
2.PNG
, it's not from 20-20k. changed to 10-100k.

What I can do?