QCustomPlot Discussion and Comments

Resetting Data in QCPcolormapReturn to overview

Hi,
I'm Plotting a color map that changes its data every second,
A function make plot creates the color map at first and then i use a function updatec that is supposed to update the data in the colormap every second.
It seems i have a problem with my setData function when updating.

void Plot::updatec(){
    double a1 , b1 , a2 , b2;
//    colorMap->data()->setSize(nx, ny);
//    colorMap->data()->setRange(QCPRange(2, 98), QCPRange(2, 98));
//    c[j][k]=100;

  for (int xIndex=0; xIndex<nx; ++xIndex)
    {
   for (int yIndex=0; yIndex<ny; ++yIndex)
      {
     colorMap->data()->cellToCoord(xIndex, yIndex, &x, &y);

        a1=((c[x+1][y]-2*c[x][y]+c[x-1][y])/(dx*dx));
        a2=((c[x][y+1]-2*c[x][y]+c[x][y-1])/(dy*dy));
        b1=((c[x+1][y]-c[x-1][y])/(2*dx));
        b2=((c[x][y+1]-c[x][y-1])/(2*dy));
        c[x][y]=c[x][y]+dt*(sigma*(a1+a2)-vx*(b1)-vy*(b2));
      c[j][k]=100;
colorMap->data()->setCell(xIndex, yIndex, c[x][y]);
  
}
}
  }

after updating the data, you need to call replot on the qcustomplot object, or it wont redraw anything.