QCustomPlot Discussion and Comments

What does the Z parameter mean when displaying the color map with QCustomerplot?Return to overview

What does the Z parameter mean when displaying the color map with QCustomerplot? How is it associated with external values?
For example, I display data in the range xy. The data is the external temperature. How can I map the temperature to the parameter Z?

void QCPColorMapData::setData (double  key, double value, double z)

z is the data at the point in the color map.

In your case that's temperature.

Can you give an example?
I want to display the temperature on a size of nx * ny
thanks
I use the following code, there is no color graphics, but a single color

colorMap = new QCPColorMap(ui->plotGrah->xAxis, ui->plotGrah->yAxis);
colorMap->data()->setSize(nx, ny);
colorMap->data()->setRange(QCPRange(1,nx), QCPRange(1,ny));

for (int xIndex=0; xIndex<nx; ++xIndex)
{
for (int yIndex=0; yIndex<ny; ++yIndex)
{
colorMap->data()->cellToCoord(xIndex, yIndex, &x, &y);
z = x+1;//This is sample data
colorMap->data()->setCell(xIndex, yIndex, z);

}
}