Skip to content
Advertisement

Tag: mplfinance

Adding arrows to mpf finance plots

I am trying to add an arrow on a given date and price to mpf plot. To do this i have the following code: But it is producing the following error: Could you please advise how can i resolve this. Answer If your ultimate goal is to add an arrow to the title of the question, you can add it

mplFinance edit x-axis to show seconds

I am wondering if there is a way to have an MPLFinance plot show more keys(time) and seconds as well as minutes. I know you are able to add the minute, but can’t find anywhere to add the seconds. Answer You can tell mpf.plot() how you want to format the datetime axis using kwarg datetime_format=. You can use any valid

Changing margin on mplfinance plot when savefig

I have the following code which produces finance plot: But the image which it generated left a lot of space on all side, so i include the parameter tight_layout=True however now i a getting an image which looks like this: The title is inside the image. Could you advise how can i change the margin where the left and right

how to draw outside mplfinance plot?

I get the error message: Is there a way to plot outside the range? Answer The workaround for this is to set show_nontrading=True I tested with your code, modifying to: and get The reason this does not work with show_nontrading=False (the default, if unspecified, value) is because in that case the x-axis values are actually just integers representing the row

Advertisement