Set Qt::NoPen
to QCPGrid::setPen
/setSubGridPen
, but not setZeroLinePen
.
How to hide grid and show only zeroline in QCustomPlot?
-
27-09-2022 - |
문제
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.
해결책
다른 팁
Current->xAxis->grid()->setSubGridVisible(false);
Current->yAxis->grid()->setSubGridVisible(false);
//grid handling
bool isGridLineVisible() const;
void setGridLineVisible(bool visible = true);
제휴하지 않습니다 StackOverflow