matplotlib / mplfinance

Financial Markets Data Visualization using Matplotlib
https://pypi.org/project/mplfinance/
Other
3.59k stars 621 forks source link

ylim kwarg for volume axes #371

Open ghost355 opened 3 years ago

ghost355 commented 3 years ago

Hi, how to set ylim for volume panel if I use code like this: mpf.plot(df, volume=ax2) I tried ax2.set_ylim(0,0.5) but it didn't work I think mpf.plot use its own setting

ghost355 commented 3 years ago

Suppose I found something ))) I need add ax2.set_ylim(0,0.5) AFTER mpf.plot()

DanielGoldfarb commented 3 years ago

Pavel,

Yes, mpf.plot() has special treatment for volume limits: Since volumes tend to be large numbers, mpf.plot() will make the the lower limit approximately 0.3 times the smallest volume (rather than zero as would otherwise normally be the case).

I thought I had implemented a volume_ylim kwarg, but I guess I only thought about it and didn't actually do it ;-)

There are a couple of workarounds (until volume_ylim is implemented)

Would you like to implement a volume_ylim kwarg and contribute to mplfinance? I can provide guidance if desired. Thanks. --Daniel

ghost355 commented 3 years ago

Thanks Daniel The way with ax.set_ylim(bottom,top) is very comfortable, I guess and gives very flexible handling. I am afraid, I have no needing skill to contribute any thing to mplfinance )))

DanielGoldfarb commented 3 years ago

OK. Thanks. I'm going to leave this issue open as a reminder to me to add a volume_ylim kwarg.