Is there a way to hide rulers from x and y axis (not grid lines)?
See the documentation of QCPAxis. You can set the tick and sub tick pen to Qt::NoPen
Qt::NoPen