QCustomPlot Discussion and Comments

grid display without any axesReturn to overview

I need to display a grid in a QCustomPlot but without any axes visible. This doesn't seems possible right now but I would like to know other opinions.

How I'm enabling grid right now :

plot->xAxis->setVisible(false);
plot->xAxis->grid()->setVisible(true);
plot->replot();

But the grid is not displayed.

I think it has to do with the fact that the grid is contained in the axis, and since the axis is not visible, the grid won't be displayed.

Does anyone know a solution for this problem ?

I think if you set ticks and ticklabels to nothing that it wont draw anything.

I do want to do the same thing... having the grid (for the xAxis) to be visible but not the axis itself!

Have some of you find a solution to this???..... as I see in the example of the "Financial Chart Demo" the top axisRect look like I want, so I guess it is possible to do so, but can't find the code that does it...

Any help will be appreciate !

what if

axis->setBasePen(QPen(Qt::translucent));
axis->setTickPen(QPen(Qt::translucent));

Or better Qt::NoPen

Thanks! Worked like a charm !

(PS. it is transparent and not translucent, but I did understand your point ! Thanks again)

Qt::NoPen worked too, and I think I'll go for this since I read that adding transparency isn't the best practice..!

Thanks Isso for this improvements!