Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

output to buffer #37

Closed
rspadim opened this issue Feb 21, 2020 · 3 comments
Closed

output to buffer #37

rspadim opened this issue Feb 21, 2020 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@rspadim
Copy link

rspadim commented Feb 21, 2020

i need to save to io.buffer
something like:

buf = io.BytesIO()
mpf.plot(
candles,
type='candle',
mav=(3, 6, 9),
volume=True,
show_nontrading=True,
figratio=(6, 6),
title="Graph",
style='yahoo',
savefig=buf
)
buf.seek(0)
@rspadim rspadim added the enhancement New feature or request label Feb 21, 2020
@DanielGoldfarb
Copy link
Collaborator

This may be possible now. Presently I don't have time to look into it; maybe in a few weeks.
In the meantime, you may try passing in the value of the savefig= kwarg as a dict (see documentation here, where cell # 7 shows passing in a dict). I think that might work. If that doesn't work, try modifying the savefig kwarg validator here to allow the correct type for an io buffer through. If that works you can submit a pull request for the change. Otherwise, as I mentioned, I may be able to look into this in a few weeks. All the best. Thanks for your suggestion. I think its a great idea.

@DanielGoldfarb DanielGoldfarb added the good first issue Good for newcomers label Feb 23, 2020
@coffincw
Copy link
Collaborator

coffincw commented Mar 4, 2020

Added with #41

@DanielGoldfarb
Copy link
Collaborator

This is now released to Pypi. Thank you Caleb Coffin @coffincw for implementing this enhancement, and for including examples in the savefig examples notebook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants