// create a scale mapping from some arbitrary data values to pixel coordinates QwtScaleMap map(0, 100, 0, 200); // map the data value of 50 to a pixel coordinate double pixelCoord = map.transform(50); // output: 100
QwtLinearScaleEngine engine; QwtScaleDiv div = engine.divideScale(0, 100, 5, 10, 10); QwtScaleMap map(div.lowerBound(), div.upperBound(), 0, 200); // iterate over the ticks in the scale division and map each one to a pixel coordinate for(int i = 0; i < div.tickCount(); ++i) { double value = div.lowerBound() + i * div.tickStep(); double pixelCoord = map.transform(value); // do something with pixelCoord }In this example, the `QwtLinearScaleEngine` class is used to divide a range of data values (`0` to `100`) into ticks, then the `QwtScaleMap` class is used to map each tick value to a pixel coordinate. The resulting pixel coordinates can be used to draw tick marks or labels on a graph. Qwt is a package library for Qt-based applications, specifically for creating graphs, plots, and other visualizations.