Skip to content

Commit ec52c80

Browse files
merge upstream/master
2 parents b567464 + a93c950 commit ec52c80

File tree

6 files changed

+103
-41
lines changed

6 files changed

+103
-41
lines changed

examples/styles.ipynb

Lines changed: 89 additions & 22 deletions
Large diffs are not rendered by default.

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/_styles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def _valid_make_mpf_style_kwargs():
6666

6767
'base_mpl_style': { 'Default' : None,
6868
'Description' : 'matplotlib style to use as base of new mplfinance style',
69-
'Validator' : lambda value: isinstance(value,str) }, # and is in plt.style.available
69+
'Validator' : lambda value: isinstance(value,(str,list))}, # and is in plt.style.available
7070

7171
'marketcolors' : { 'Default' : None,
7272
'Description' : 'market colors object, from `mpf.make_market_colors()`',

src/mplfinance/_version.py

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

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

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)