customPlot->plotLayout()->insertRow(0); customPlot->plotLayout()->addElement(0, 0, new QCPTextElement(customPlot, "Way too many graphs in one plot", QFont("sans", 12, QFont::Bold))); //设置各个轴的标签 customPlot->xAxis->setLabel("Bottom axis with outward ticks"); customPlot->yA...
customPlot->yAxis2->setRange(-70,35);//为顶轴设置刻度为pi相关刻度customPlot->xAxis2->setTicker(QSharedPointer<QCPAxisTickerPi>(newQCPAxisTickerPi));//添加标题布局customPlot->plotLayout()->insertRow(0); customPlot->plotLayout()->addElement(0,0,newQCPTextElement(customPlot,"Way too many gr...
customPlot->plotLayout()->insertRow(0); customPlot->plotLayout()->addElement(0, 0, new QCPTextElement(customPlot, "数据图表", QFont("sans", 12, QFont::Bold))); customPlot->xAxis->setLabel("时间"); customPlot->yAxis->setLabel("数据"); 将数据传入二维数组中,并绘制图表。 代码语...
customPlot->yAxis2->setRange(-70,35);//为顶轴设置刻度为pi相关刻度customPlot->xAxis2->setTicker(QSharedPointer<QCPAxisTickerPi>(newQCPAxisTickerPi));//添加标题布局customPlot->plotLayout()->insertRow(0); customPlot->plotLayout()->addElement(0,0,newQCPTextElement(customPlot,"Way too many gr...
customPlot->plotLayout()->insertColumn(0); QCPAxisRect *legendRect = new QCPAxisRect(customPlot, false); // 不需要配置轴,因为我们只是把图例放在这里 legendRect->setAutoMargins(QCP::msNone); // 不计算边距 legendRect->insetLayout()->addElement(customPlot->legend, Qt::AlignCenter); // 放置...
(0, maxY + 2); //将坐标轴添加到布局中 layout->addElement(i, 0, axisRect); //添加对应的画布,对应坐标轴为刚刚产生的坐标轴,底部作为X轴,左侧作为Y轴 QCPGraph *graph = plot->addGraph(xAxis, yAxis); //开启平滑算法 graph->setSmooth(ui->cboxSmooth->currentIndex()); //关闭抗锯齿 //...
customPlot->plotLayout()->addElement(1, 0, colorScale); // 在颜色图下面显示 heatmap->setColorScale(colorScale); QCPColorGradient gradient; // 色条使用的颜色渐变 gradient.setColorStopAt(0.0, QColor("#f6efa6")); // 设置色条开始时的颜色 ...
}intcount = plot->plotLayout()->elementCount();for(inti =0; i < count; ++i) {//拿到对应画布的坐标轴QCPAxisRect *axisRect = (QCPAxisRect *)plot->plotLayout()->elementAt(i); QCPAxis *xAxis = axisRect->axis(QCPAxis::atBottom); ...
layout->addElement(i,0,axisRect); //添加对应的画布,对应坐标轴为刚刚产生的坐标轴,底部作为X轴,左侧作为Y轴 QCPGraph*graph=plot->addGraph(xAxis,yAxis); //开启平滑算法 graph->setSmooth(ui->cboxSmooth->currentIndex()); //关闭抗锯齿
customPlot->plotLayout()->addElement(0, 0, new QCPTextElement(customPlot, "Way too many graphs in one plot", QFont("sans", 12, QFont::Bold))); // set labels: customPlot->xAxis->setLabel("Bottom axis with outward ticks"); customPlot->yAxis->setLabel("Left axis label"); customPlot...