@@ -234,3 +234,36 @@ This also means there is a new keyword argument for `.axes.Axes.get_tightbbox`:
234
234
bounding box using the rules above. `.axis.Axis.get_tightbbox ` gets an
235
235
``ignore_label `` keyword argument, which is *None * by default, but which can
236
236
also be 'x' or 'y'.
237
+
238
+ When using a single dataset, `Axes.hist ` no longer wraps the added artist in a `silent_list `
239
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
240
+
241
+ When `Axes.hist() ` is called with a single dataset, it adds to the axes either
242
+ a `BarContainer ` object (when ``histtype="bar" `` or ``"barstacked" ``), or a
243
+ `Polygon ` object (when ``histype="step" `` or ``"stepfilled" ``) -- the latter
244
+ being wrapped in a list-of-one-element. Previously, either artist would be
245
+ wrapped in a `silent_list `. This is no longer the case: the `BarContainer ` is
246
+ now returned as is (this is an API breaking change if you were directly relying
247
+ on the concrete `list ` API; however, `BarContainer ` inherits from `tuple ` so
248
+ most common operations remain available), and the list-of-one `Polygon ` is
249
+ returned as is. This makes the `repr ` of the returned artist more accurate: it
250
+ is now ::
251
+
252
+ <BarContainer object of of 10 artists> # "bar", "barstacked"
253
+ [<matplotlib.patches.Polygon object at 0xdeadbeef>] # "step", "stepfilled"
254
+
255
+ instead of ::
256
+
257
+ <a list of 10 Patch objects> # "bar", "barstacked"
258
+ <a list of 1 Patch objects> # "step", "stepfilled"
259
+
260
+ When `Axes.hist() ` is called with multiple artists, it still wraps its return
261
+ value in a `silent_list `, but uses more accurate type information ::
262
+
263
+ <a list of 3 BarContainer objects> # "bar", "barstacked"
264
+ <a list of 3 List[Polygon] objects> # "step", "stepfilled"
265
+
266
+ instead of ::
267
+
268
+ <a list of 3 Lists of Patches objects> # "bar", "barstacked"
269
+ <a list of 3 Lists of Patches objects> # "step", "stepfilled"
0 commit comments