Skip to content

Cropping space outside of the chart #143

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

Closed
Jacks349 opened this issue May 24, 2020 · 6 comments
Closed

Cropping space outside of the chart #143

Jacks349 opened this issue May 24, 2020 · 6 comments
Labels
question Further information is requested

Comments

@Jacks349
Copy link

Hello! I'm playing with Renko candles and i'm trying to correct a little detail on my chart: when i save the chart, there is always some free space outside of the chart, on the right. I would like to crop or fill that space, here is what i mean:

q

Here is how i generate the chart:
mpf.plot(df, volume=Volume, type='renko', mav=MovingAverages, renko_params=dict(brick_size=brick_size), figscale=0.5, figratio=(50, 50), style=s, savefig="renkochart.png")

I tried to change figratio, but of course it will only make the chart wider/higher, but it won't remove that space; is there any way to do this? Maybe i need to use MPL? By the way, the Renko charts generated by this library are awesome!

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

Hi @Jacks349 ,

Instead of: savefig="renkochart.png",

try: savefig=dict(fname="renkochart.png",bbox_inches="tight").

Let me know if that works.

--Daniel

@Jacks349
Copy link
Author

Works flawlessly! Thank you a lot @DanielGoldfarb !

@DanielGoldfarb
Copy link
Collaborator

@Jacks349
Anytime. By the way, I like the colors on your chart. Nice choice!

@Jacks349
Copy link
Author

Jacks349 commented May 24, 2020

@DanielGoldfarb Thank you! Yes, it looks good! Here are the colors i used, in case anyone wanted to replicate:
Background (chart and outer chart): #131722. Candle up: #00bed4, candle down: #EB4D5C. Created this style on top of Nightclouds.

@ang-jason
Copy link

Hi Daniel, wrong on the same logic. Upon viewing the chart, how do i remove the excess white space. the above is save plot. Thanks

@DanielGoldfarb
Copy link
Collaborator

@ang-jason
See above regarding bbox_inches="tight" and see also #212 (comment).

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

No branches or pull requests

3 participants