@@ -241,3 +241,36 @@ also be 'x' or 'y'.
241
241
This newly allowed value for :rc: `savefig.facecolor ` and :rc: `savefig.edgecolor `,
242
242
as well as the *facecolor * and *edgecolor * parameters to `.Figure.savefig `, means
243
243
"use whatever facecolor and edgecolor the figure current has".
244
+
245
+ When using a single dataset, `.Axes.hist ` no longer wraps the added artist in a `.silent_list `
246
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
247
+
248
+ When `.Axes.hist ` is called with a single dataset, it adds to the axes either
249
+ a `.BarContainer ` object (when ``histtype="bar" `` or ``"barstacked" ``), or a
250
+ `.Polygon ` object (when ``histype="step" `` or ``"stepfilled" ``) -- the latter
251
+ being wrapped in a list-of-one-element. Previously, either artist would be
252
+ wrapped in a `.silent_list `. This is no longer the case: the `.BarContainer ` is
253
+ now returned as is (this is an API breaking change if you were directly relying
254
+ on the concrete `list ` API; however, `.BarContainer ` inherits from `tuple ` so
255
+ most common operations remain available), and the list-of-one `.Polygon ` is
256
+ returned as is. This makes the `repr ` of the returned artist more accurate: it
257
+ is now ::
258
+
259
+ <BarContainer object of of 10 artists> # "bar", "barstacked"
260
+ [<matplotlib.patches.Polygon object at 0xdeadbeef>] # "step", "stepfilled"
261
+
262
+ instead of ::
263
+
264
+ <a list of 10 Patch objects> # "bar", "barstacked"
265
+ <a list of 1 Patch objects> # "step", "stepfilled"
266
+
267
+ When `.Axes.hist ` is called with multiple artists, it still wraps its return
268
+ value in a `.silent_list `, but uses more accurate type information ::
269
+
270
+ <a list of 3 BarContainer objects> # "bar", "barstacked"
271
+ <a list of 3 List[Polygon] objects> # "step", "stepfilled"
272
+
273
+ instead of ::
274
+
275
+ <a list of 3 Lists of Patches objects> # "bar", "barstacked"
276
+ <a list of 3 Lists of Patches objects> # "step", "stepfilled"
0 commit comments