Open ghost355 opened 3 years ago
Suppose I found something )))
I need add
ax2.set_ylim(0,0.5)
AFTER mpf.plot()
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)
Axes.set_ylim()
after calling mpf.plot()
. This works for both external axes mode and for returnfig=True
mode.make_addplot()
to plot something (even a single data point) on the same axes as the volume, and pass ylim
kwarg into make_addplot()
(you may also have to pass in secondary_y=False
to ensure the ylim
gets applied to the correct primary volume axis).Would you like to implement a volume_ylim
kwarg and contribute to mplfinance? I can provide guidance if desired.
Thanks. --Daniel
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 )))
OK. Thanks. I'm going to leave this issue open as a reminder to me to add a volume_ylim
kwarg.
Hi, how to set ylim for volume panel if I use code like this:
mpf.plot(df, volume=ax2)
I triedax2.set_ylim(0,0.5)
but it didn't work I think mpf.plot use its own setting