ui->w1->xAxis->setRange(-5,5); ui->w1->yAxis->setRange(0,5); QVector<double>a(11),b(11); a<<0<<1<<2<<3<<4<<4<<4<<3<<2<<1<<0; b<<-5<<-4<<-3<<-2<<-1<<0<<1<<2<<3<<4<<5; ui->w1->addGraph(ui->w1->xAxis,ui->w1->yAxis); ui->w1->graph(0)->setData(b,a);

We cant see point (0,5) the graph dips to Zero and we get straight line on y axis of value 5 units then on positive side it starts from zero instead of 5.

how to improve/avoid this?