Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions pandas/plotting/_matplotlib/hist.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,16 @@ def _get_column_weights(weights, i: int, y):

def _post_plot_logic(self, ax: Axes, data) -> None:
if self.orientation == "horizontal":
# error: Argument 1 to "set_xlabel" of "_AxesBase" has incompatible
# type "Hashable"; expected "str"
ax.set_xlabel(
"Frequency" if self.xlabel is None else self.xlabel # type: ignore[arg-type]
"Frequency" if self.xlabel is None else str(self.xlabel) # type: ignore[arg-type]
)
ax.set_ylabel(
self.ylabel if isinstance(self.ylabel, str) else str(self.ylabel) # type: ignore[arg-type]
)
ax.set_ylabel(self.ylabel) # type: ignore[arg-type]
else:
ax.set_xlabel(self.xlabel) # type: ignore[arg-type]
ax.set_xlabel(
self.xlabel if isinstance(self.xlabel, str) else str(self.xlabel) # type: ignore[arg-type]
)
ax.set_ylabel(
"Frequency" if self.ylabel is None else self.ylabel # type: ignore[arg-type]
)
Expand Down
Loading