QCustomPlot Discussion and Comments

Vertical and polar graphsReturn to overview

hi everyone,

i want to use vertical and polar graphs. i have 2 button, i want ; one button draw vertical plot and other button draw polar plot in same customplot widget. When i try to draw polar graphs then vertical graphs, the app has crash. What can i do about the switch between graphics ?


i found some code ;

    QCPLayoutElement * temp = ui->customPlot->plotLayout()->element(0,0);
    if(temp != nullptr){

    QCPAxisRect *defaultAxisRect = new QCPAxisRect(ui->customPlot, true);
    ui->customPlot->plotLayout()->addElement(0, 0, defaultAxisRect);

i put this code every button func(polar graph funcs is use QCPPolarAxisAngular)

i want to read legend in widget for vertical graphs, but when i put cod in under,


app crash again.

sorry about my English :)