Adnan
Adnan

Reputation: 2996

How to hide grid and show only zeroline in QCustomPlot?

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.

Upvotes: 5

Views: 3820

Answers (3)

Sayan Bera
Sayan Bera

Reputation: 135

//grid handling
bool isGridLineVisible() const;
void setGridLineVisible(bool visible = true);

Upvotes: 0

Mounir Madjour
Mounir Madjour

Reputation: 9

Current->xAxis->grid()->setSubGridVisible(false); 
Current->yAxis->grid()->setSubGridVisible(false);

Upvotes: 0

DerManu
DerManu

Reputation: 720

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

Upvotes: 5

Related Questions