QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_box_statistics.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *
9 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 *****************************************************************************/
11
12#ifndef QWT_BOX_STATISTICS_H
13#define QWT_BOX_STATISTICS_H
14
15#include "qwtcore_global.h"
16#include "qwt_samples.h"
17
18#include <qvector.h>
19
26class QWTCORE_EXPORT QwtBoxStatisticsCalculator
27{
28public:
33 {
36
39
42
45
47 StandardError
48 };
49
51 static QwtBoxSample
52 calculate(double position, const QVector< double >& sortedData, WhiskerMethod method = Tukey, double coefficient = 1.5);
53
55 static QwtBoxSample calculateFromRaw(double position,
56 const QVector< double >& rawData,
57 WhiskerMethod method = Tukey,
58 double coefficient = 1.5);
59
61 static QVector< double > extractOutliers(const QwtBoxSample& sample, const QVector< double >& sortedData);
62
64 static void calculateFull(double position,
65 const QVector< double >& rawData,
66 QwtBoxSample& sample,
67 QwtBoxOutlierSample& outliers,
68 WhiskerMethod method = Tukey,
69 double coefficient = 1.5);
70
71private:
73 static double quantile(const QVector< double >& sorted, double p);
74
76 static double median(const QVector< double >& sorted);
77
79 static double iqr(const QVector< double >& sorted);
80
82 static double mean(const QVector< double >& data);
83
85 static double standardDeviation(const QVector< double >& data);
86
88 static QVector< double > sortData(const QVector< double >& data);
89};
90
91#endif // QWT_BOX_STATISTICS_H
Outlier values for a single boxplot position
Definition qwt_samples.h:475
Sample for box-and-whisker plot (boxplot) visualization
Definition qwt_samples.h:364
Helper class for computing boxplot statistics from raw data
Definition qwt_box_statistics.h:27
WhiskerMethod
Whisker calculation method
Definition qwt_box_statistics.h:33
@ MinMax
Min/Max method: whiskers at actual data min/max
Definition qwt_box_statistics.h:41
@ StandardDeviation
Standard deviation method: whiskers at mean ± coeff×SD
Definition qwt_box_statistics.h:44
@ Percentile
Percentile method: whiskers at the c-th / (100-c)-th percentile (c = tail percentage)
Definition qwt_box_statistics.h:38
@ Tukey
Tukey's method: whiskers extend to 1.5×IQR from Q1/Q3 (default)
Definition qwt_box_statistics.h:35