Added xlabel= kwarg to mpf.plot() by vedant-gawande · Pull Request #564 · matplotlib/mplfinance (original) (raw)

It turns out that apparently this was not tested at all. A little bit of testing showed that it was not working for all cases where the main plot is not the bottom-most panel.

  1. In panels mode, the xlabel should always be on the bottom panel, and it makes no sense for addplot to support xlabel (since it will always be on the bottom-most panel). Therefore moved xlabel implementation into _set_ticks_on_bottom_panel_only() when in panels mode.
  2. In external axes mode, the user can always call Axes.set_xlabel() directly on whichever axes they choose, so again no need to support xlabel in addplot.

This changes were made and merged into the PR.

@vedant-gawande Thank you for contributing to mplfinance! Wishing you all the best.