Skip to content

Is it possible to do "bbox_inches='tight'" when saving a fig? #117

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
3dvg opened this issue May 3, 2020 · 2 comments
Closed

Is it possible to do "bbox_inches='tight'" when saving a fig? #117

3dvg opened this issue May 3, 2020 · 2 comments
Labels
question Further information is requested

Comments

@3dvg
Copy link

3dvg commented May 3, 2020

In mpl-finance, when saving an image without using bbox_inches='tight' saved the image with big white areas surrounding the plot, Just like what happens with the current mplfinance.

How it should looks like with bbox_inches='tight':
descarga (2)

How it looks like now:
7e563426-ff13-467b-ae1c-238cde353116

Notice the big white margins

Is there any way to achieve what bbox_inches='tight' does with the current mplfinance package?

@3dvg 3dvg added the question Further information is requested label May 3, 2020
@DanielGoldfarb
Copy link
Collaborator

I will look into this. Possibly will do. ( or it will become do-able through #17 )

@DanielGoldfarb
Copy link
Collaborator

@3dvg
Eduardo
Yes, you can do this already. See "Specifying image attributes with savefig" just below cell number 8 in this notebook and see also cell number 9 in the same notebook.

You can specify bbox_inches='tight' when using the savefig kwarg:

mpf.plot( data, savefig=dict(fname='myfile',bbox_inches='tight') )

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants