MCPcopy Create free account
hub / github.com/KDE/labplot / showKDEPlot

Method showKDEPlot

src/frontend/spreadsheet/StatisticsColumnWidget.cpp:339–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339void StatisticsColumnWidget::showKDEPlot() {
340 // add plot
341 auto* plot = addPlot(&m_kdePlotWidget);
342
343 // set the axes labels
344 auto axes = plot->children<Axis>();
345 for (auto* axis : std::as_const(axes)) {
346 if (axis->orientation() == Axis::Orientation::Horizontal)
347 axis->title()->setText(m_column->name());
348 else
349 axis->title()->setText(i18n("Density"));
350
351 axis->setMinorTicksDirection(Axis::noTicks);
352 }
353
354 QApplication::processEvents(QEventLoop::AllEvents, 100);
355
356 // add normalized histogram
357 auto* histogram = new Histogram(QString());
358 plot->addChild(histogram);
359 histogram->setNormalization(Histogram::ProbabilityDensity);
360 histogram->setDataColumn(m_column);
361
362 // add KDE Plot
363 auto* kdePlot = new KDEPlot(QString());
364 plot->addChild(kdePlot);
365 kdePlot->setKernelType(nsl_kernel_gauss);
366 kdePlot->setBandwidthType(nsl_kde_bandwidth_silverman);
367 kdePlot->setDataColumn(m_column);
368
369 m_kdePlotInitialized = true;
370}
371
372void StatisticsColumnWidget::showQQPlot() {
373 // add plot

Callers

nothing calls this directly

Calls 11

setNormalizationMethod · 0.80
setKernelTypeMethod · 0.80
setBandwidthTypeMethod · 0.80
QStringClass · 0.50
orientationMethod · 0.45
setTextMethod · 0.45
titleMethod · 0.45
nameMethod · 0.45
addChildMethod · 0.45
setDataColumnMethod · 0.45

Tested by

no test coverage detected