QCustomPlot Discussion and Comments

Change color of top and right axis Return to overview

Hello I want to change the color top and right axis how can I do that ?
I managed to change the color of the other 2 axis with :

            widget->xAxis->setTickLabelColor(colcode);
            widget->xAxis->setBasePen(QPen(colcode));
            widget->xAxis->setLabelColor(colcode);
            widget->xAxis->setTickPen(QPen(colcode));
            widget->xAxis->setSubTickPen(QPen(colcode));

            widget->yAxis->setTickLabelColor(colcode);
            widget->yAxis->setBasePen(QPen(colcode));
            widget->yAxis->setLabelColor(colcode);
            widget->yAxis->setTickPen(QPen(colcode));
            widget->yAxis->setSubTickPen(QPen(colcode));

Thanks :D

Also wandering how to change the color of the grid

I changed the axis colors using yAxis2 and xAxis2 but still don't know about the grid.
By the way great job !

So I found how to do it, here is my code to change all the colors of a plot exept for data lines :

          foreach(QCustomPlot *widget ,PlotList) {
            widget->xAxis->setTickLabelColor(colcode);
            widget->xAxis->setBasePen(QPen(colcode));
            widget->xAxis->setLabelColor(colcode);
            widget->xAxis->setTickPen(QPen(colcode));
            widget->xAxis->setSubTickPen(QPen(colcode));
            widget->xAxis->grid()->setPen(QPen(colcode));
            widget->xAxis->grid()->setSubGridPen(QPen(colcode));

            widget->xAxis2->setTickLabelColor(colcode);
            widget->xAxis2->setBasePen(QPen(colcode));
            widget->xAxis2->setLabelColor(colcode);
            widget->xAxis2->setTickPen(QPen(colcode));
            widget->xAxis2->setSubTickPen(QPen(colcode));

            widget->yAxis->setTickLabelColor(colcode);
            widget->yAxis->setBasePen(QPen(colcode));
            widget->yAxis->setLabelColor(colcode);
            widget->yAxis->setTickPen(QPen(colcode));
            widget->yAxis->setSubTickPen(QPen(colcode));
            widget->yAxis->grid()->setPen(QPen(colcode));
            widget->yAxis->grid()->setSubGridPen(QPen(colcode));

            widget->yAxis2->setTickLabelColor(colcode);
            widget->yAxis2->setBasePen(QPen(colcode));
            widget->yAxis2->setLabelColor(colcode);
            widget->yAxis2->setTickPen(QPen(colcode));
            widget->yAxis2->setSubTickPen(QPen(colcode));

            widget->replot();
        }