Skip to content

Commit 2d22a74

Browse files
Merge branch 'master' into master
2 parents 4e64135 + 7a3f2ca commit 2d22a74

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

src/mplfinance/_arg_validators.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,9 @@ def _get_valid_plot_types(plottype=None):
9393

9494
if plottype is None:
9595
return _valid_types_all
96-
97-
if plottype not in _valid_types_all:
98-
return None
9996
elif plottype in _alias_types:
10097
return _alias_types[plottype]
101-
else:
102-
return plottype
98+
return plottype
10399

104100

105101
def _mav_validator(mav_value):

src/mplfinance/_panels.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ def _build_panels( figure, config ):
2222
------
2323
The following items are used from `config`:
2424
25-
num_panels : integer (0-9) or None
25+
num_panels : integer (0-31) or None
2626
number of panels to create
2727
2828
addplot : dict or None
2929
value for the `addplot=` kwarg passed into `mplfinance.plot()`
3030
31-
volume_panel : integer (0-9) or None
31+
volume_panel : integer (0-31) or None
3232
panel id (0-number_of_panels)
3333
34-
main_panel : integer (0-9) or None
34+
main_panel : integer (0-31) or None
3535
panel id (0-number_of_panels)
3636
3737
panel_ratios : sequence or None
@@ -68,7 +68,7 @@ def _build_panels( figure, config ):
6868
panel_ratios = config['panel_ratios']
6969

7070
if not _valid_panel_id(main_panel):
71-
raise ValueError('main_panel id must be integer 0 to 9, but is '+str(main_panel))
71+
raise ValueError('main_panel id must be integer 0 to 31, but is '+str(main_panel))
7272

7373
if num_panels is None: # then infer the number of panels:
7474
pset = {0} # start with a set including only panel zero
@@ -85,12 +85,12 @@ def _build_panels( figure, config ):
8585
if panel in backwards_panel_compatibility:
8686
panel = backwards_panel_compatibility[panel]
8787
if not _valid_panel_id(panel):
88-
raise ValueError('addplot panel must be integer 0 to 9, but is "'+str(panel)+'"')
88+
raise ValueError('addplot panel must be integer 0 to 31, but is "'+str(panel)+'"')
8989
pset.add(panel)
9090

9191
if volume is True:
9292
if not _valid_panel_id(volume_panel):
93-
raise ValueError('volume_panel must be integer 0 to 9, but is "'+str(volume_panel)+'"')
93+
raise ValueError('volume_panel must be integer 0 to 31, but is "'+str(volume_panel)+'"')
9494
pset.add(volume_panel)
9595

9696
pset.add(main_panel)

src/mplfinance/_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
21
version_info = (0, 12, 8, 'beta', 11)
32

43
_specifier_ = {'alpha': 'a','beta': 'b','candidate': 'rc','final': ''}
54

65
__version__ = '%s.%s.%s%s'%(version_info[0], version_info[1], version_info[2],
7-
'' if version_info[3]=='final' else _specifier_[version_info[3]]+str(version_info[4]))
6+
'' if version_info[3]=='final' else _specifier_[version_info[3]]+str(version_info[4]))

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+
plt.show(block=config['block']) # 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)