You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method accepts the keyword arguments but ignores them and overrides them with defaults (respectively and "Frequency". While those defaults are sensible, specifying those keyword arguments should either be met with the intended output (custom x and y labels) or an error (of the type NotImplementedError)
The documentation (for hist and plot) seem to indicate this is supported (although a bit unclear)
Expected Output
The outputted graph should be the same as when produced with the following code:
I started looking into this and there seems to be possible interaction with orientation, because xlabel and ylabel seemed to be set depending on orientation. I changed HistPlot.__init__() to
def __init__(self, data, bins=10, bottom=0, **kwargs):
self.bins = bins # use mpl default
self.bottom = bottom
# Do not call LinePlot.__init__ which may fill nan
MPLPlot.__init__(self, data, **kwargs)
# getting x and y label
if "xlabel" in kwargs.keys():
self.xlabel = kwargs["xlabel"]
if "ylabel" in kwargs.keys():
self.ylabel = kwargs["ylabel"]
and then changed the label setter in HistPlot._plot_plot_logic to
def _post_plot_logic(self, ax: Axes, data):
if self.orientation == "horizontal":
if self.xlabel is not None:
ax.set_xlabel(self.xlabel)
else:
ax.set_xlabel("Frequency")
else:
if self.ylabel is not None:
ax.set_ylabel(self.ylabel)
else:
ax.set_ylabel("Frequency")
and xlabel and ylabel are set depending upon orientation of the plot.
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
Output graph:
Problem description
The method accepts the keyword arguments but ignores them and overrides them with defaults (respectively and "Frequency". While those defaults are sensible, specifying those keyword arguments should either be met with the intended output (custom x and y labels) or an error (of the type
NotImplementedError
)The documentation (for hist and plot) seem to indicate this is supported (although a bit unclear)
Expected Output
The outputted graph should be the same as when produced with the following code:
Which is the following:
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: