matplotlib/mplfinance

Minor enhancements on some simple plot handling

Lenbus opened this issue · 2 comments

Lenbus commented

I will collect some minor things, that bother me from time to time and should be quite easy to fix :)

  • ax.axhline(y=100) and ax.axvline(x=100) could be merged to make ax.axline(x=None, y=None)
    That way, you'd just have to switch the kwarg for a 90°-turn, which just seems a bit more logical to me than the redundant axHline corresponding y=... and v corresponding with x=...

  • to rotate ticklabels you have to call: plot.set_xticklabels(plot.get_xticklabels(), rotation=90)
    Why not taking the existing labels as default argument here?
    It would also be feasable to add label rotation as an argument within the plot attributes or provide a more oop-inspired approch, such as: plot.ticks.x.rotation = 90 or plot.ticks.x(rotation = 90)

@Lenbus
It's not clear to me what's bothering you, because the examples you gave appear to be related to matplotlib, and not to mplfinance. (Or perhaps you are using mplfinance in External Axes mode???)

Are you aware that mplfinance has a kwarg xrotation= for setting the x axis labels rotation degrees? (See, for example, this).

Lenbus commented

Hey, thanks for your response. My fault: I wanted to post this as a matplotlib feature request/enhancement.