5

Is there any way of showing zeroline in QCustomPlot while hiding grid? I have tried hiding grid with following line:

ui->customPlot->xAxis->grid()->setVisible(false);
ui->customPlot->yAxis->grid()->setVisible(false);

But this also hides the zerolines. I need to keep zerolines visible.

Maxim Makhun
  • 2,197
  • 1
  • 22
  • 26
Adnan
  • 2,986
  • 7
  • 43
  • 63

3 Answers3

5

Set Qt::NoPen to QCPGrid::setPen/setSubGridPen, but not setZeroLinePen.

DerManu
  • 702
  • 4
  • 12
0
Current->xAxis->grid()->setSubGridVisible(false); 
Current->yAxis->grid()->setSubGridVisible(false);
Gluttton
  • 5,739
  • 3
  • 31
  • 58
0
//grid handling
bool isGridLineVisible() const;
void setGridLineVisible(bool visible = true);
Sayan Bera
  • 135
  • 2
  • 16