rock_widget_collection  0.1
Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
QCPStatisticalBox Class Reference

A plottable representing a single statistical box in a plot. More...

#include <qcustomplot.h>

Inherits QCPAbstractPlottable.

Public Slots

double key () const
 
double minimum () const
 
double lowerQuartile () const
 
double median () const
 
double upperQuartile () const
 
double maximum () const
 
QVector< double > outliers () const
 
double width () const
 
double whiskerWidth () const
 
QPen whiskerPen () const
 
QPen whiskerBarPen () const
 
QPen medianPen () const
 
double outlierSize () const
 
QPen outlierPen () const
 
QBrush outlierBrush () const
 
void setKey (double key)
 
void setMinimum (double value)
 
void setLowerQuartile (double value)
 
void setMedian (double value)
 
void setUpperQuartile (double value)
 
void setMaximum (double value)
 
void setOutliers (const QVector< double > &values)
 
void setData (double key, double minimum, double lowerQuartile, double median, double upperQuartile, double maximum)
 
void setWidth (double width)
 
void setWhiskerWidth (double width)
 
void setWhiskerPen (const QPen &pen)
 
void setWhiskerBarPen (const QPen &pen)
 
void setMedianPen (const QPen &pen)
 
void setOutlierSize (double pixels)
 
void setOutlierPen (const QPen &pen)
 
void setOutlierBrush (const QBrush &brush)
 
virtual void clearData ()
 
- Public Slots inherited from QCPAbstractPlottable
QCustomPlotparentPlot () const
 
QString name () const
 
bool visible () const
 
QPen pen () const
 
QBrush brush () const
 
QCPAxiskeyAxis () const
 
QCPAxisvalueAxis () const
 
void setName (const QString &name)
 
void setVisible (bool visible)
 
void setPen (const QPen &pen)
 
void setBrush (const QBrush &brush)
 
void setKeyAxis (QCPAxis *axis)
 
void setValueAxis (QCPAxis *axis)
 
void rescaleAxes (bool onlyEnlarge=false) const
 
void rescaleKeyAxis (bool onlyEnlarge=false) const
 
void rescaleValueAxis (bool onlyEnlarge=false) const
 
virtual void clearData ()=0
 
virtual bool addToLegend () const
 
virtual bool removeFromLegend () const
 

Public Member Functions

 QCPStatisticalBox (QCPAxis *keyAxis, QCPAxis *valueAxis)
 
virtual ~QCPStatisticalBox ()
 
- Public Member Functions inherited from QCPAbstractPlottable
 QCPAbstractPlottable (QCPAxis *keyAxis, QCPAxis *valueAxis)
 
virtual ~QCPAbstractPlottable ()
 

Protected Member Functions

virtual void draw (QPainter *painter) const
 
virtual void drawLegendIcon (QPainter *painter, const QRect &rect) const
 
virtual void drawQuartileBox (QPainter *painter) const
 
virtual void drawMedian (QPainter *painter) const
 
virtual void drawWhiskers (QPainter *painter) const
 
virtual void drawOutliers (QPainter *painter) const
 
virtual QCPRange getKeyRange (bool &validRange, SignDomain inSignDomain=SDBoth) const
 
virtual QCPRange getValueRange (bool &validRange, SignDomain inSignDomain=SDBoth) const
 
- Protected Member Functions inherited from QCPAbstractPlottable
void coordsToPixels (double key, double value, double &x, double &y) const
 
const QPointF coordsToPixels (double key, double value) const
 

Protected Attributes

QVector< double > mOutliers
 
double mKey
 
double mMinimum
 
double mLowerQuartile
 
double mMedian
 
double mUpperQuartile
 
double mMaximum
 
double mWidth
 
double mWhiskerWidth
 
double mOutlierSize
 
QPen mWhiskerPen
 
QPen mWhiskerBarPen
 
QPen mOutlierPen
 
QPen mMedianPen
 
QBrush mOutlierBrush
 
- Protected Attributes inherited from QCPAbstractPlottable
QCustomPlotmParentPlot
 
QString mName
 
bool mVisible
 
QPen mPen
 
QBrush mBrush
 
QCPAxismKeyAxis
 
QCPAxismValueAxis
 

Friends

class QCustomPlot
 
class QCPLegend
 

Additional Inherited Members

- Protected Types inherited from QCPAbstractPlottable
enum  SignDomain { SDNegative, SDBoth, SDPositive }
 

Detailed Description

A plottable representing a single statistical box in a plot.

To plot data, assign it with the individual parameter functions or use setData to set all parameters at once. The individual funcions are:

Additionally you can define a list of outliers, drawn as circle datapoints:

Changing the appearance

The appearance of the box itself is controlled via setPen and setBrush. You may change the width of the box with setWidth in plot coordinates (not pixels).

Analog functions exist for the minimum/maximum-whiskers: setWhiskerPen, setWhiskerBarPen, setWhiskerWidth. The whisker width is the width of the bar at the top (maximum) or bottom (minimum).

The median indicator line has its own pen, setMedianPen.

If the pens are changed, especially the median and whisker pen, make sure to set the capStyle to Qt::FlatCap. Else, e.g. the median line might exceed the quartile box by a few pixels due to the pen cap being not perfectly flat.

The Outlier data points are drawn as circles. Their look can be controlled with setOutlierPen and setOutlierBrush. The size (diameter) can be set with setOutlierSize in pixels.

Usage

Like all data representing objects in QCustomPlot, the QCPStatisticalBox is a plottable (QCPAbstractPlottable). So the plottable-interface of QCustomPlot applies (QCustomPlot::plottable, QCustomPlot::addPlottable, QCustomPlot::removePlottable, etc.)

Usually, you first create an instance:

QCPStatisticalBox *newBox = new QCPStatisticalBox(customPlot->xAxis, customPlot->yAxis);

add it to the customPlot with QCustomPlot::addPlottable:

customPlot->addPlottable(newBox);

and then modify the properties of the newly created plottable, e.g.:

newBox->setName("Measurement Series 1");
newBox->setData(1, 3, 4, 5, 7);
newBox->setOutliers(QVector<double>() << 0.5 << 0.64 << 7.2 << 7.42);

Definition at line 422 of file qcustomplot.h.

Constructor & Destructor Documentation

QCPStatisticalBox::QCPStatisticalBox ( QCPAxis keyAxis,
QCPAxis valueAxis 
)
explicit

Constructs a statistical box which uses keyAxis as its key axis ("x") and valueAxis as its value axis ("y"). keyAxis and valueAxis must both reside in the same QCustomPlot.

The constructed statistical box can be added to the plot with QCustomPlot::addPlottable, QCustomPlot then takes ownership of the statistical box.

Definition at line 7577 of file qcustomplot.cc.

7577  :
7578  QCPAbstractPlottable(keyAxis, valueAxis),
7579  mKey(0),
7580  mMinimum(0),
7581  mLowerQuartile(0),
7582  mMedian(0),
7583  mUpperQuartile(0),
7584  mMaximum(0)
7585 {
7586  QPen whiskerPen;
7587  whiskerPen.setStyle(Qt::DashLine);
7588  whiskerPen.setCapStyle(Qt::FlatCap);
7589  setWhiskerPen(whiskerPen);
7590  setWhiskerWidth(0.2);
7591 
7592  QPen medianPen;
7593  medianPen.setWidthF(3);
7594  medianPen.setCapStyle(Qt::FlatCap);
7595  setMedianPen(medianPen);
7596 
7597  setBrush(Qt::NoBrush);
7598  setWidth(0.5);
7599 
7600  QPen outlierPen;
7601  outlierPen.setColor(Qt::blue);
7602  setOutlierPen(outlierPen);
7603  setOutlierBrush(Qt::NoBrush);
7604  setOutlierSize(5);
7605 }
void setMedianPen(const QPen &pen)
void setWhiskerWidth(double width)
void setWhiskerPen(const QPen &pen)
void setWidth(double width)
QPen medianPen() const
Definition: qcustomplot.h:442
QCPAbstractPlottable(QCPAxis *keyAxis, QCPAxis *valueAxis)
void setOutlierBrush(const QBrush &brush)
QPen whiskerPen() const
Definition: qcustomplot.h:440
void setBrush(const QBrush &brush)
void setOutlierPen(const QPen &pen)
QPen outlierPen() const
Definition: qcustomplot.h:444
void setOutlierSize(double pixels)
QCPStatisticalBox::~QCPStatisticalBox ( )
virtual

Definition at line 7607 of file qcustomplot.cc.

7608 {
7609 }

Member Function Documentation

void QCPStatisticalBox::clearData ( )
virtualslot

Definition at line 7790 of file qcustomplot.cc.

7791 {
7792  setOutliers(QVector<double>());
7793  setKey(0);
7794  setMinimum(0);
7795  setLowerQuartile(0);
7796  setMedian(0);
7797  setUpperQuartile(0);
7798  setMaximum(0);
7799 }
void setOutliers(const QVector< double > &values)
void setLowerQuartile(double value)
void setMedian(double value)
void setMinimum(double value)
void setMaximum(double value)
void setUpperQuartile(double value)
void setKey(double key)
void QCPStatisticalBox::draw ( QPainter *  painter) const
protectedvirtual

Implements QCPAbstractPlottable.

Definition at line 7802 of file qcustomplot.cc.

7803 {
7804  if (!mVisible) return;
7805  painter->setClipRect(mKeyAxis->axisRect().united(mValueAxis->axisRect()));
7806 
7807  painter->setRenderHint(QPainter::Antialiasing, mParentPlot->antialiasedElements().testFlag(QCustomPlot::AEGraphs));
7808  drawQuartileBox(painter);
7809  drawMedian(painter);
7810  drawWhiskers(painter);
7811  drawOutliers(painter);
7812 }
QRect axisRect() const
Definition: qcustomplot.h:743
QCustomPlot * mParentPlot
Definition: qcustomplot.h:153
virtual void drawMedian(QPainter *painter) const
virtual void drawQuartileBox(QPainter *painter) const
virtual void drawWhiskers(QPainter *painter) const
const AntialiasedElements antialiasedElements() const
Definition: qcustomplot.h:949
virtual void drawOutliers(QPainter *painter) const
void QCPStatisticalBox::drawLegendIcon ( QPainter *  painter,
const QRect &  rect 
) const
protectedvirtual

Implements QCPAbstractPlottable.

Definition at line 7815 of file qcustomplot.cc.

7816 {
7817  // draw filled rect:
7818  painter->setRenderHint(QPainter::Antialiasing, mParentPlot->antialiasedElements().testFlag(QCustomPlot::AEGraphs));
7819  painter->setPen(mPen);
7820  painter->setBrush(mBrush);
7821  QRect r = QRect(0, 0, rect.width()*0.67, rect.height()*0.67);
7822  r.moveCenter(rect.center());
7823  painter->drawRect(r);
7824 }
QCustomPlot * mParentPlot
Definition: qcustomplot.h:153
const AntialiasedElements antialiasedElements() const
Definition: qcustomplot.h:949
void QCPStatisticalBox::drawMedian ( QPainter *  painter) const
protectedvirtual

Definition at line 7844 of file qcustomplot.cc.

7845 {
7846  QLineF medianLine;
7847  medianLine.setP1(coordsToPixels(mKey-mWidth*0.5, mMedian));
7848  medianLine.setP2(coordsToPixels(mKey+mWidth*0.5, mMedian));
7849  painter->setPen(mMedianPen);
7850  painter->drawLine(medianLine);
7851 }
void coordsToPixels(double key, double value, double &x, double &y) const
void QCPStatisticalBox::drawOutliers ( QPainter *  painter) const
protectedvirtual

Definition at line 7876 of file qcustomplot.cc.

7877 {
7878  painter->setPen(mOutlierPen);
7879  painter->setBrush(mOutlierBrush);
7880  for (int i=0; i<mOutliers.size(); ++i)
7881  painter->drawEllipse(coordsToPixels(mKey, mOutliers.at(i)), mOutlierSize*0.5, mOutlierSize*0.5);
7882 }
void coordsToPixels(double key, double value, double &x, double &y) const
QVector< double > mOutliers
Definition: qcustomplot.h:469
void QCPStatisticalBox::drawQuartileBox ( QPainter *  painter) const
protectedvirtual

Definition at line 7830 of file qcustomplot.cc.

7831 {
7832  QRectF box;
7833  box.setTopLeft(coordsToPixels(mKey-mWidth*0.5, mUpperQuartile));
7834  box.setBottomRight(coordsToPixels(mKey+mWidth*0.5, mLowerQuartile));
7835  painter->setPen(mPen);
7836  painter->setBrush(mBrush);
7837  painter->drawRect(box);
7838 }
void coordsToPixels(double key, double value, double &x, double &y) const
void QCPStatisticalBox::drawWhiskers ( QPainter *  painter) const
protectedvirtual

Definition at line 7857 of file qcustomplot.cc.

7858 {
7859  QLineF backboneMin, backboneMax, barMin, barMax;
7860  backboneMax.setPoints(coordsToPixels(mKey, mUpperQuartile), coordsToPixels(mKey, mMaximum));
7861  backboneMin.setPoints(coordsToPixels(mKey, mLowerQuartile), coordsToPixels(mKey, mMinimum));
7864  painter->setPen(mWhiskerPen);
7865  painter->drawLine(backboneMin);
7866  painter->drawLine(backboneMax);
7867  painter->setPen(mWhiskerBarPen);
7868  painter->drawLine(barMin);
7869  painter->drawLine(barMax);
7870 }
void coordsToPixels(double key, double value, double &x, double &y) const
QCPRange QCPStatisticalBox::getKeyRange ( bool &  validRange,
SignDomain  inSignDomain = SDBoth 
) const
protectedvirtual

Implements QCPAbstractPlottable.

Definition at line 7885 of file qcustomplot.cc.

7886 {
7887  validRange = mWidth > 0;
7888  if (inSignDomain == SDBoth)
7889  {
7890  return QCPRange(mKey-mWidth*0.5, mKey+mWidth*0.5);
7891  } else if (inSignDomain == SDNegative)
7892  {
7893  if (mKey+mWidth*0.5 < 0)
7894  return QCPRange(mKey-mWidth*0.5, mKey+mWidth*0.5);
7895  else if (mKey < 0)
7896  return QCPRange(mKey-mWidth*0.5, mKey);
7897  else
7898  {
7899  validRange = false;
7900  return QCPRange();
7901  }
7902  } else if (inSignDomain == SDPositive)
7903  {
7904  if (mKey-mWidth*0.5 > 0)
7905  return QCPRange(mKey-mWidth*0.5, mKey+mWidth*0.5);
7906  else if (mKey > 0)
7907  return QCPRange(mKey, mKey+mWidth*0.5);
7908  else
7909  {
7910  validRange = false;
7911  return QCPRange();
7912  }
7913  }
7914  validRange = false;
7915  return QCPRange();
7916 }
Both sign domains, including zero, i.e. all (rational) numbers.
Definition: qcustomplot.h:150
The negative sign domain, i.e. numbers smaller than zero.
Definition: qcustomplot.h:149
The positive sign domain, i.e. numbers greater than zero.
Definition: qcustomplot.h:151
Represents the range an axis is encompassing.
Definition: qcustomplot.h:491
QCPRange QCPStatisticalBox::getValueRange ( bool &  validRange,
SignDomain  inSignDomain = SDBoth 
) const
protectedvirtual

Implements QCPAbstractPlottable.

Definition at line 7919 of file qcustomplot.cc.

7920 {
7921  if (inSignDomain == SDBoth)
7922  {
7923  double lower = qMin(mMinimum, qMin(mMedian, mLowerQuartile));
7924  double upper = qMax(mMaximum, qMax(mMedian, mUpperQuartile));
7925  for (int i=0; i<mOutliers.size(); ++i)
7926  {
7927  if (mOutliers.at(i) < lower)
7928  lower = mOutliers.at(i);
7929  if (mOutliers.at(i) > upper)
7930  upper = mOutliers.at(i);
7931  }
7932  validRange = upper > lower;
7933  return QCPRange(lower, upper);
7934  } else
7935  {
7936  QVector<double> values; // values that must be considered (i.e. all outliers and the five box-parameters)
7937  values.reserve(mOutliers.size() + 5);
7938  values << mMaximum << mUpperQuartile << mMedian << mLowerQuartile << mMinimum;
7939  values << mOutliers;
7940  // go through values and find the ones in legal range:
7941  bool haveUpper = false;
7942  bool haveLower = false;
7943  double upper = 0;
7944  double lower = 0;
7945  for (int i=0; i<values.size(); ++i)
7946  {
7947  if ((inSignDomain == SDNegative && values.at(i) < 0) ||
7948  (inSignDomain == SDPositive && values.at(i) > 0))
7949  {
7950  if (values.at(i) > upper || !haveUpper)
7951  {
7952  upper = values.at(i);
7953  haveUpper = true;
7954  }
7955  if (values.at(i) < lower || !haveLower)
7956  {
7957  lower = values.at(i);
7958  haveLower = true;
7959  }
7960  }
7961  }
7962  // return the bounds if we found some sensible values:
7963  if (haveLower && haveUpper && !qFuzzyCompare(upper+1.0, lower+1.0))
7964  {
7965  validRange = true;
7966  return QCPRange(lower, upper);
7967  } else
7968  {
7969  validRange = false;
7970  return QCPRange();
7971  }
7972  }
7973 }
Both sign domains, including zero, i.e. all (rational) numbers.
Definition: qcustomplot.h:150
QVector< double > mOutliers
Definition: qcustomplot.h:469
The negative sign domain, i.e. numbers smaller than zero.
Definition: qcustomplot.h:149
The positive sign domain, i.e. numbers greater than zero.
Definition: qcustomplot.h:151
Represents the range an axis is encompassing.
Definition: qcustomplot.h:491
double QCPStatisticalBox::key ( ) const
inlineslot

Definition at line 431 of file qcustomplot.h.

431 { return mKey; }
double QCPStatisticalBox::lowerQuartile ( ) const
inlineslot

Definition at line 433 of file qcustomplot.h.

433 { return mLowerQuartile; }
double QCPStatisticalBox::maximum ( ) const
inlineslot

Definition at line 436 of file qcustomplot.h.

436 { return mMaximum; }
double QCPStatisticalBox::median ( ) const
inlineslot

Definition at line 434 of file qcustomplot.h.

434 { return mMedian; }
QPen QCPStatisticalBox::medianPen ( ) const
inlineslot

Definition at line 442 of file qcustomplot.h.

442 { return mMedianPen; }
double QCPStatisticalBox::minimum ( ) const
inlineslot

Definition at line 432 of file qcustomplot.h.

432 { return mMinimum; }
QBrush QCPStatisticalBox::outlierBrush ( ) const
inlineslot

Definition at line 445 of file qcustomplot.h.

445 { return mOutlierBrush; }
QPen QCPStatisticalBox::outlierPen ( ) const
inlineslot

Definition at line 444 of file qcustomplot.h.

444 { return mOutlierPen; }
QVector<double> QCPStatisticalBox::outliers ( ) const
inlineslot

Definition at line 437 of file qcustomplot.h.

437 { return mOutliers; }
QVector< double > mOutliers
Definition: qcustomplot.h:469
double QCPStatisticalBox::outlierSize ( ) const
inlineslot

Definition at line 443 of file qcustomplot.h.

443 { return mOutlierSize; }
void QCPStatisticalBox::setData ( double  key,
double  minimum,
double  lowerQuartile,
double  median,
double  upperQuartile,
double  maximum 
)
slot

Sets all parameters of the statistical box plot at once.

See Also
setKey, setMinimum, setLowerQuartile, setMedian, setUpperQuartile, setMaximum

Definition at line 7694 of file qcustomplot.cc.

7695 {
7696  setKey(key);
7699  setMedian(median);
7702 }
double maximum() const
Definition: qcustomplot.h:436
void setLowerQuartile(double value)
double minimum() const
Definition: qcustomplot.h:432
void setMedian(double value)
void setMinimum(double value)
double upperQuartile() const
Definition: qcustomplot.h:435
double lowerQuartile() const
Definition: qcustomplot.h:433
void setMaximum(double value)
void setUpperQuartile(double value)
double median() const
Definition: qcustomplot.h:434
void setKey(double key)
double key() const
Definition: qcustomplot.h:431
void QCPStatisticalBox::setKey ( double  key)
slot

Sets the key coordinate of the statistical box.

Definition at line 7614 of file qcustomplot.cc.

7615 {
7616  mKey = key;
7617 }
double key() const
Definition: qcustomplot.h:431
void QCPStatisticalBox::setLowerQuartile ( double  value)
slot

Sets the parameter "lower Quartile" of the statistical box plot. This is the lower end of the box. The lower and the upper quartiles are the two statistical quartiles around the median of the sample, they contain 50% of the sample data.

See Also
setUpperQuartile, setPen, setBrush, setWidth

Definition at line 7637 of file qcustomplot.cc.

7638 {
7639  mLowerQuartile = value;
7640 }
void QCPStatisticalBox::setMaximum ( double  value)
slot

Sets the parameter "maximum" of the statistical box plot. This is the position of the upper whisker, typically the maximum measurement of the sample that's not considered an outlier.

See Also
setMinimum, setWhiskerPen, setWhiskerBarPen, setWhiskerWidth

Definition at line 7672 of file qcustomplot.cc.

7673 {
7674  mMaximum = value;
7675 }
void QCPStatisticalBox::setMedian ( double  value)
slot

Sets the parameter "median" of the statistical box plot. This is the value of the median mark inside the quartile box. The median separates the sample data in half (50% of the sample data is below/above the median).

See Also
setMedianPen

Definition at line 7649 of file qcustomplot.cc.

7650 {
7651  mMedian = value;
7652 }
void QCPStatisticalBox::setMedianPen ( const QPen &  pen)
slot

Sets the pen used for drawing the median indicator line inside the statistical box.

Make sure to set the pen capStyle to Qt::FlatCap to prevent the median line from reaching a few pixels outside the box, when using a non-zero pen width.

Definition at line 7754 of file qcustomplot.cc.

7755 {
7756  mMedianPen = pen;
7757 }
QPen pen() const
Definition: qcustomplot.h:124
void QCPStatisticalBox::setMinimum ( double  value)
slot

Sets the parameter "minimum" of the statistical box plot. This is the position of the lower whisker, typically the minimum measurement of the sample that's not considered an outlier.

See Also
setMaximum, setWhiskerPen, setWhiskerBarPen, setWhiskerWidth

Definition at line 7625 of file qcustomplot.cc.

7626 {
7627  mMinimum = value;
7628 }
void QCPStatisticalBox::setOutlierBrush ( const QBrush &  brush)
slot

Sets the brush used to fill the outlier circles.

See Also
setOutlierSize, setOutlierPen, setOutliers

Definition at line 7784 of file qcustomplot.cc.

7785 {
7786  mOutlierBrush = brush;
7787 }
QBrush brush() const
Definition: qcustomplot.h:125
void QCPStatisticalBox::setOutlierPen ( const QPen &  pen)
slot

Sets the pen used to draw the outlier circles.

See Also
setOutlierSize, setOutlierBrush, setOutliers

Definition at line 7774 of file qcustomplot.cc.

7775 {
7776  mOutlierPen = pen;
7777 }
QPen pen() const
Definition: qcustomplot.h:124
void QCPStatisticalBox::setOutliers ( const QVector< double > &  values)
slot

Sets a vector of outlier values that will be drawn as circles. Any data points in the sample that are not within the whiskers (setMinimum, setMaximum) should be considered outliers and displayed as such.

See Also
setOutlierPen, setOutlierBrush, setOutlierSize

Definition at line 7684 of file qcustomplot.cc.

7685 {
7686  mOutliers = values;
7687 }
QVector< double > mOutliers
Definition: qcustomplot.h:469
void QCPStatisticalBox::setOutlierSize ( double  pixels)
slot

Sets the pixel size (diameter) of the circles that represent the outliers.

See Also
setOutlierPen, setOutlierBrush, setOutliers

Definition at line 7764 of file qcustomplot.cc.

7765 {
7766  mOutlierSize = pixels;
7767 }
void QCPStatisticalBox::setUpperQuartile ( double  value)
slot

Sets the parameter "upper Quartile" of the statistical box plot. This is the upper end of the box. The lower and the upper quartiles are the two statistical quartiles around the median of the sample, they contain 50% of the sample data.

See Also
setLowerQuartile, setPen, setBrush, setWidth

Definition at line 7661 of file qcustomplot.cc.

7662 {
7663  mUpperQuartile = value;
7664 }
void QCPStatisticalBox::setWhiskerBarPen ( const QPen &  pen)
slot

Sets the pen used for drawing the whisker bars (Those are the lines parallel to the key axis at each end of the backbone).

See Also
setWhiskerPen

Definition at line 7743 of file qcustomplot.cc.

7744 {
7745  mWhiskerBarPen = pen;
7746 }
QPen pen() const
Definition: qcustomplot.h:124
void QCPStatisticalBox::setWhiskerPen ( const QPen &  pen)
slot

Sets the pen used for drawing the whisker backbone (That's the line parallel to the value axis).

Make sure to set the pen capStyle to Qt::FlatCap to prevent the backbone from reaching a few pixels past the bars, when using a non-zero pen width.

See Also
setWhiskerBarPen

Definition at line 7732 of file qcustomplot.cc.

7733 {
7734  mWhiskerPen = pen;
7735 }
QPen pen() const
Definition: qcustomplot.h:124
void QCPStatisticalBox::setWhiskerWidth ( double  width)
slot

Sets the width of the whiskers (setMinimum, setMaximum) in key coordinates.

See Also
setWidth

Definition at line 7719 of file qcustomplot.cc.

7720 {
7721  mWhiskerWidth = width;
7722 }
double width() const
Definition: qcustomplot.h:438
void QCPStatisticalBox::setWidth ( double  width)
slot

Sets the width of the box in key coordinates.

See Also
setWhiskerWidth

Definition at line 7709 of file qcustomplot.cc.

7710 {
7711  mWidth = width;
7712 }
double width() const
Definition: qcustomplot.h:438
double QCPStatisticalBox::upperQuartile ( ) const
inlineslot

Definition at line 435 of file qcustomplot.h.

435 { return mUpperQuartile; }
QPen QCPStatisticalBox::whiskerBarPen ( ) const
inlineslot

Definition at line 441 of file qcustomplot.h.

441 { return mWhiskerBarPen; }
QPen QCPStatisticalBox::whiskerPen ( ) const
inlineslot

Definition at line 440 of file qcustomplot.h.

440 { return mWhiskerPen; }
double QCPStatisticalBox::whiskerWidth ( ) const
inlineslot

Definition at line 439 of file qcustomplot.h.

439 { return mWhiskerWidth; }
double QCPStatisticalBox::width ( ) const
inlineslot

Definition at line 438 of file qcustomplot.h.

438 { return mWidth; }

Friends And Related Function Documentation

friend class QCPLegend
friend

Definition at line 488 of file qcustomplot.h.

friend class QCustomPlot
friend

Definition at line 487 of file qcustomplot.h.

Member Data Documentation

double QCPStatisticalBox::mKey
protected

Definition at line 470 of file qcustomplot.h.

double QCPStatisticalBox::mLowerQuartile
protected

Definition at line 470 of file qcustomplot.h.

double QCPStatisticalBox::mMaximum
protected

Definition at line 470 of file qcustomplot.h.

double QCPStatisticalBox::mMedian
protected

Definition at line 470 of file qcustomplot.h.

QPen QCPStatisticalBox::mMedianPen
protected

Definition at line 474 of file qcustomplot.h.

double QCPStatisticalBox::mMinimum
protected

Definition at line 470 of file qcustomplot.h.

QBrush QCPStatisticalBox::mOutlierBrush
protected

Definition at line 475 of file qcustomplot.h.

QPen QCPStatisticalBox::mOutlierPen
protected

Definition at line 474 of file qcustomplot.h.

QVector<double> QCPStatisticalBox::mOutliers
protected

Definition at line 469 of file qcustomplot.h.

double QCPStatisticalBox::mOutlierSize
protected

Definition at line 473 of file qcustomplot.h.

double QCPStatisticalBox::mUpperQuartile
protected

Definition at line 470 of file qcustomplot.h.

QPen QCPStatisticalBox::mWhiskerBarPen
protected

Definition at line 474 of file qcustomplot.h.

QPen QCPStatisticalBox::mWhiskerPen
protected

Definition at line 474 of file qcustomplot.h.

double QCPStatisticalBox::mWhiskerWidth
protected

Definition at line 472 of file qcustomplot.h.

double QCPStatisticalBox::mWidth
protected

Definition at line 471 of file qcustomplot.h.


The documentation for this class was generated from the following files: