Hello, I'm currently trying to plot a large amount of data (read and loaded into dataMatrix). The dataMatrix is a QVector<QVector<double>> where there are 2 vectors with a size of ~4 mil each. Copying the data into a new vector is no problem, but when i try to setData, the program crashes and gives an std::bad_alloc error. I tried my code on a smaller QVector and it seems to work as expected. Is there a work around when graphing large data at a single time?

    QCPGraph* curGraph = customPlot->addGraph(arHolder->axis(QCPAxis::atBottom), arHolder->axis(QCPAxis::atLeft));
    QVector<double> xVector= QVector<double>(dataMatrix[xIndex]);
    QVector<double> yVector = QVector<double>(dataMatrix[yIndex]);
    curGraph->setData(xVector, yVector);