1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. currentmodule:: wx.lib.plot.polyobjects
.. highlight:: python
.. _wx.lib.plot.polyobjects.PolyBoxPlot:
==========================================================================================================================================
|phoenix_title| **wx.lib.plot.polyobjects.PolyBoxPlot**
==========================================================================================================================================
Creates a PolyBoxPlot object.
:param data: Raw data to create a box plot from.
:type data: sequence of int or float
:param **attr: keyword attributes
================================= ============= =======================
Keyword and Default Description Type
================================= ============= =======================
``colour='black'`` edge color :class:`wx.Colour`
``width=1`` edge width float
``style=wx.PENSTYLE_SOLID`` edge style :class:`wx.PenStyle`
``legend=''`` legend string str
================================= ============= =======================
.. note::
``np.NaN`` and ``np.inf`` values are ignored.
.. admonition:: TODO
+ [ ] Figure out a better way to get multiple box plots side-by-side
(current method is a hack).
+ [ ] change the X axis to some labels.
+ [ ] Change getClosestPoint to only grab box plot items and outlers?
Currently grabs every data point.
+ [ ] Add more customization such as Pens/Brushes, outlier shapes/size,
and box width.
+ [ ] Figure out how I want to handle log-y: log data then calcBP? Or
should I calc the BP first then the plot it on a log scale?
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html
<div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
<img id="toggleBlock-trigger" src="_static/images/closed.png"/>
Inheritance diagram for class <strong>PolyBoxPlot</strong>:
</div>
<div id="toggleBlock-summary" style="display:block;"></div>
<div id="toggleBlock-content" style="display:none;">
<p class="graphviz">
<center><img src="_static/images/inheritance/wx.lib.plot.polyobjects.PolyBoxPlot_inheritance.png" alt="Inheritance diagram of PolyBoxPlot" usemap="#dummy" class="inheritance"/></center>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.plot.polyobjects.PolyBoxPlot.html" title="wx.lib.plot.polyobjects.PolyBoxPlot" alt="" coords="5,83,256,112"/> <area shape="rect" id="node2" href="wx.lib.plot.polyobjects.PolyPoints.html" title="wx.lib.plot.polyobjects.PolyPoints" alt="" coords="10,5,251,35"/> </map>
</p>
</div>
|
|super_classes| Known Superclasses
==================================
:class:`wx.lib.plot.polyobjects.PolyPoints`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.plot.polyobjects.PolyBoxPlot.__init__` Initialize self. See help(type(self)) for accurate signature.
:meth:`~wx.lib.plot.polyobjects.PolyBoxPlot.boundingBox` Returns bounding box for the plot.
:meth:`~wx.lib.plot.polyobjects.PolyBoxPlot.calcBpData` Box plot points
:meth:`~wx.lib.plot.polyobjects.PolyBoxPlot.calcOutliers` Calculates the outliers. Must be called after calcBpData.
:meth:`~wx.lib.plot.polyobjects.PolyBoxPlot.draw` Draws a box plot on the DC.
:meth:`~wx.lib.plot.polyobjects.PolyBoxPlot.getClosestPoint` Returns the index of closest point on the curve, pointXY,
:meth:`~wx.lib.plot.polyobjects.PolyBoxPlot.getSymExtent` Width and Height of Marker
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: PolyBoxPlot(PolyPoints)
Creates a PolyBoxPlot object.
:param data: Raw data to create a box plot from.
:type data: sequence of int or float
:param **attr: keyword attributes
================================= ============= =======================
Keyword and Default Description Type
================================= ============= =======================
``colour='black'`` edge color :class:`wx.Colour`
``width=1`` edge width float
``style=wx.PENSTYLE_SOLID`` edge style :class:`wx.PenStyle`
``legend=''`` legend string str
================================= ============= =======================
.. note::
``np.NaN`` and ``np.inf`` values are ignored.
.. admonition:: TODO
+ [ ] Figure out a better way to get multiple box plots side-by-side
(current method is a hack).
+ [ ] change the X axis to some labels.
+ [ ] Change getClosestPoint to only grab box plot items and outlers?
Currently grabs every data point.
+ [ ] Add more customization such as Pens/Brushes, outlier shapes/size,
and box width.
+ [ ] Figure out how I want to handle log-y: log data then calcBP? Or
should I calc the BP first then the plot it on a log scale?
.. method:: __init__(self, points, \*\*attr)
Initialize self. See help(type(self)) for accurate signature.
.. method:: boundingBox(self)
Returns bounding box for the plot.
Override method.
.. method:: calcBpData(self, data=None)
Box plot points:
Median (50%)
75%
25%
low_whisker = lowest value that's >= (25% - (IQR * 1.5))
high_whisker = highest value that's <= 75% + (IQR * 1.5)
outliers are outside of 1.5 * IQR
Parameters
----------
data : array-like
The data to plot
Returns
-------
bpdata : collections.namedtuple
Descriptive statistics for data:
(min_data, low_whisker, q25, median, q75, high_whisker, max_data)
.. method:: calcOutliers(self, data=None)
Calculates the outliers. Must be called after calcBpData.
.. method:: draw(self, dc, printerScale, coord=None)
Draws a box plot on the DC.
Notes
-----
The following draw order is required:
1. First the whisker line
2. Then the IQR box
3. Lasly the median line.
This is because
+ The whiskers are drawn as single line rather than two lines
+ The median line must be visible over the box if the box has a fill.
Other than that, the draw order can be changed.
.. method:: getClosestPoint(self, pntXY, pointScaled=True)
Returns the index of closest point on the curve, pointXY,
scaledXY, distance x, y in user coords.
Override method.
if pointScaled == True, then based on screen coords
if pointScaled == False, then based on user coords
.. method:: getSymExtent(self, printerScale)
Width and Height of Marker
|