I have a plot where I would like to set an arbitrary scale on the X-axis (defined using a linear equation). How can I achieve this?

More details:
I have a spectrum, where the X-axis is "channels" (integers, from 0-2048 or however many channels are present) and the Y-axis is "counts". I would like to convert the X-axis scale to "energy" (channel converted to energy, using a linear equation). I've been experimenting with inheriting QwtTransform, defining the virtual methods transform() and invTransform(), then setting
Qt Code:
  1. this->axisScaleEngine(QwtPlot::xBottom)->setTransformation(new MyTransform())
To copy to clipboard, switch view to plain text mode 
but to no avail. Am I on the right track?

Thanks!