Skip to content
Advertisement

Changing margin on mplfinance plot when savefig

I have the following code which produces finance plot:

JavaScript

enter image description here

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:

enter image description here

The title is inside the image. Could you advise how can i change the margin where the left and right are tight and title is on top. Also how can you add a secondary title to the image

Advertisement

Answer

Extra configuration can be passed to position the title when title option is passed as a dictionary.

For example,

JavaScript

To add a secondary title. You’ll need control of the plot axis.

You can write:

JavaScript

controlled axis for matplotlib finance

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement