Skip to content

Commit d674480

Browse files
authored
Feature request #510
to show only specific figure created in plotting.py instead of using plt.show we use fig.show. #510
1 parent 7234f2f commit d674480

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/mplfinance/plotting.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -855,18 +855,18 @@ def plot( data, **kwargs ):
855855
save = config['savefig']
856856
if isinstance(save,dict):
857857
if config['tight_layout'] and 'bbox_inches' not in save:
858-
plt.savefig(**save,bbox_inches='tight')
858+
fig.savefig(**save,bbox_inches='tight')
859859
else:
860-
plt.savefig(**save)
860+
fig.savefig(**save)
861861
else:
862862
if config['tight_layout']:
863-
plt.savefig(save,bbox_inches='tight')
863+
fig.savefig(save,bbox_inches='tight')
864864
else:
865-
plt.savefig(save)
865+
fig.savefig(save)
866866
if config['closefig']: # True or 'auto'
867867
plt.close(fig)
868868
elif not config['returnfig']:
869-
plt.show(block=config['block']) # https://stackoverflow.com/a/13361748/1639359
869+
fig.show() # https://stackoverflow.com/a/13361748/1639359
870870
if config['closefig'] == True or (config['block'] and config['closefig']):
871871
plt.close(fig)
872872

0 commit comments

Comments
 (0)