Skip to content

Commit

Permalink
Feature request matplotlib#510
Browse files Browse the repository at this point in the history
to show only specific figure created in plotting.py instead of using plt.show we use fig.show. matplotlib#510
  • Loading branch information
anbarief authored Mar 27, 2022
1 parent 7234f2f commit d674480
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mplfinance/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,18 +855,18 @@ def plot( data, **kwargs ):
save = config['savefig']
if isinstance(save,dict):
if config['tight_layout'] and 'bbox_inches' not in save:
plt.savefig(**save,bbox_inches='tight')
fig.savefig(**save,bbox_inches='tight')
else:
plt.savefig(**save)
fig.savefig(**save)
else:
if config['tight_layout']:
plt.savefig(save,bbox_inches='tight')
fig.savefig(save,bbox_inches='tight')
else:
plt.savefig(save)
fig.savefig(save)
if config['closefig']: # True or 'auto'
plt.close(fig)
elif not config['returnfig']:
plt.show(block=config['block']) # https://stackoverflow.com/a/13361748/1639359
fig.show() # https://stackoverflow.com/a/13361748/1639359
if config['closefig'] == True or (config['block'] and config['closefig']):
plt.close(fig)

Expand Down

0 comments on commit d674480

Please sign in to comment.