We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba7e83d commit 0ac3bfaCopy full SHA for 0ac3bfa
pandas/plotting/_matplotlib/hist.py
@@ -447,13 +447,26 @@ def hist_series(
447
ax = fig.gca()
448
elif ax.get_figure() != fig:
449
raise AssertionError("passed axis not bound to passed figure")
450
+
451
+ ## inferring xlabel from the Series
452
+ if hasattr(self,'name'):
453
+ xlabel=self.name
454
+ else:
455
+ xlabel=None
456
457
values = self.dropna().values
458
if legend:
459
kwds["label"] = self.name
460
ax.hist(values, bins=bins, **kwds)
461
462
ax.legend()
463
ax.grid(grid)
464
465
+ ## setting xlabel
466
+ ax.set(
467
+ xlabel=xlabel
468
+ )
469
470
axes = np.array([ax])
471
472
set_ticks_props(
0 commit comments