Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1a06081

Browse files
committed
added some comments to boxplot
1 parent d7a4a8c commit 1a06081

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3184,11 +3184,13 @@ def dopatch(xs, ys, **kwargs):
31843184
N = len(bxpstats)
31853185
datashape_message = "List of boxplot statistics and `{0}` " \
31863186
"value must have same length"
3187+
# check postision
31873188
if positions is None:
31883189
positions = list(xrange(1, N + 1))
31893190
elif len(positions) != N:
31903191
raise ValueError(datashape_message.format("positions"))
31913192

3193+
# width
31923194
if widths is None:
31933195
distance = max(positions) - min(positions)
31943196
widths = [min(0.15 * max(distance, 1.0), 0.5)] * N
@@ -3197,9 +3199,9 @@ def dopatch(xs, ys, **kwargs):
31973199
elif len(widths) != N:
31983200
raise ValueError(datashape_message.format("widths"))
31993201

3202+
# check and save the `hold` state of the current axes
32003203
if not self._hold:
32013204
self.cla()
3202-
32033205
holdStatus = self._hold
32043206

32053207
for pos, width, stats in zip(positions, widths, bxpstats):

0 commit comments

Comments
 (0)