Skip to content

Commit c228078

Browse files
more kwarg descriptions
1 parent 8bf4874 commit c228078

File tree

1 file changed

+34
-28
lines changed

1 file changed

+34
-28
lines changed

src/mplfinance/plotting.py

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def _valid_plot_kwargs():
129129
'Validator' : lambda value: isinstance(value,dict) },
130130

131131
'study' : { 'Default' : None,
132-
'Description' : '',
132+
'Description' : 'kwarg not implemented',
133133
'Validator' : lambda value: _kwarg_not_implemented(value) },
134134

135135
'marketcolor_overrides' : { 'Default' : None,
@@ -143,7 +143,7 @@ def _valid_plot_kwargs():
143143
'Validator' : lambda value: isinstance(value,bool) },
144144

145145
'no_xgaps' : { 'Default' : True, # None means follow default logic below:
146-
'Description' : '',
146+
'Description' : 'deprecated',
147147
'Validator' : lambda value: _warn_no_xgaps_deprecated(value) },
148148

149149
'show_nontrading' : { 'Default' : False,
@@ -211,30 +211,29 @@ def _valid_plot_kwargs():
211211
' user must display plot when ready, usually by calling `mpf.show()`',
212212
'Validator' : lambda value: isinstance(value,bool) },
213213

214-
'return_calculated_values' : { 'Default' : None,
214+
'return_calculated_values' : { 'Default' : None,
215215
'Description' : 'set to a variable containing an empty dict; `mpf.plot()` will fill'+
216216
' the dict with various mplfinance calculated values',
217-
'Validator' : lambda value: isinstance(value, dict) and len(value) == 0},
217+
'Validator' : lambda value: isinstance(value, dict) and len(value) == 0},
218218

219-
'set_ylim' : { 'Default' : None,
220-
'Description' : '',
221-
'Validator' : lambda value: _warn_set_ylim_deprecated(value) },
219+
'set_ylim' : { 'Default' : None,
220+
'Description' : 'deprecated',
221+
'Validator' : lambda value: _warn_set_ylim_deprecated(value) },
222222

223-
'ylim' : { 'Default' : None,
223+
'ylim' : { 'Default' : None,
224224
'Description' : 'Limits for y-axis as tuple (min,max), i.e. (bottom,top)',
225-
'Validator' : lambda value: isinstance(value, (list,tuple)) and len(value) == 2
225+
'Validator' : lambda value: isinstance(value, (list,tuple)) and len(value) == 2
226226
and all([isinstance(v,(int,float)) for v in value])},
227227

228-
'xlim' : { 'Default' : None,
228+
'xlim' : { 'Default' : None,
229229
'Description' : 'Limits for x-axis as tuple (min,max), i.e. (left,right)',
230-
'Validator' : lambda value: _xlim_validator(value) },
230+
'Validator' : lambda value: _xlim_validator(value) },
231231

232-
'set_ylim_panelB' : { 'Default' : None,
233-
'Description' : '',
234-
'Validator' : lambda value: _warn_set_ylim_deprecated(value) },
232+
'set_ylim_panelB' : { 'Default' : None,
233+
'Description' : 'deprecated',
234+
'Validator' : lambda value: _warn_set_ylim_deprecated(value) },
235235

236236
'hlines' : { 'Default' : None,
237-
'Description' : '',
238237
'Description' : 'Draw one or more HORIZONTAL LINES across entire plot, by'+
239238
' specifying a price, or sequence of prices. May also be a dict'+
240239
' with key `hlines` specifying a price or sequence of prices, plus'+
@@ -274,19 +273,19 @@ def _valid_plot_kwargs():
274273
all([isinstance(v,(int,float)) for v in value]) },
275274

276275
'main_panel' : { 'Default' : 0,
277-
'Description' : '',
276+
'Description' : 'integer - which panel is the main panel for `.plot()`',
278277
'Validator' : lambda value: _valid_panel_id(value) },
279278

280279
'volume_panel' : { 'Default' : 1,
281-
'Description' : '',
280+
'Description' : 'integer - which panel is the volume panel',
282281
'Validator' : lambda value: _valid_panel_id(value) },
283282

284283
'num_panels' : { 'Default' : None,
285-
'Description' : '',
286-
'Validator' : lambda value: isinstance(value,int) and value in range(1,10+1) },
284+
'Description' : 'total number of panels',
285+
'Validator' : lambda value: isinstance(value,int) and value in range(1,32+1) },
287286

288287
'datetime_format' : { 'Default' : None,
289-
'Description' : '',
288+
'Description' : 'x-axis tick format as valid `strftime()` format string',
290289
'Validator' : lambda value: isinstance(value,str) },
291290

292291
'xrotation' : { 'Default' : 45,
@@ -298,21 +297,32 @@ def _valid_plot_kwargs():
298297
'Validator' : lambda value: isinstance(value,bool) },
299298

300299
'closefig' : { 'Default' : 'auto',
301-
'Description' : '',
300+
'Description' : 'True|False close the Figure before returning',
302301
'Validator' : lambda value: isinstance(value,bool) },
303302

304303
'fill_between' : { 'Default' : None,
305-
'Description' : '',
304+
'Description' : 'fill between specification as y-value, or sequence of'+
305+
' y-values, or dict containing key "y1" plus any additional'+
306+
' kwargs for `fill_between()`',
306307
'Validator' : lambda value: _num_or_seq_of_num(value) or
307308
(isinstance(value,dict) and 'y1' in value and
308309
_num_or_seq_of_num(value['y1'])) },
309310

310311
'tight_layout' : { 'Default' : False,
311-
'Description' : '',
312+
'Description' : 'True|False implement tight layout (minimal padding around Figure)'+
313+
' (see also `scale_padding` kwarg)',
312314
'Validator' : lambda value: isinstance(value,bool) },
313315

316+
'scale_padding' : { 'Default' : 1.0, # Issue#193
317+
'Description' : 'Increase, > 1.0, or decrease, < 1.0, padding around figure.'+
318+
' May also be a dict containing one or more of the following keys:'+
319+
' "top", "bottom", "left", "right", to individual scale padding'+
320+
' on each side of Figure.',
321+
'Validator' : lambda value: _scale_padding_validator(value) },
322+
314323
'width_adjuster_version' : { 'Default' : 'v1',
315-
'Description' : '',
324+
'Description' : 'specify version of object width adjustment algorithm: "v0" or "v1"'+
325+
' (See also "widths" tutorial in mplfinance examples folder).',
316326
'Validator' : lambda value: value in ('v0', 'v1') },
317327

318328
'scale_width_adjustment' : { 'Default' : None,
@@ -331,10 +341,6 @@ def _valid_plot_kwargs():
331341
'Description' : '',
332342
'Validator' : lambda value: isinstance(value,bool) },
333343

334-
'scale_padding' : { 'Default' : 1.0, # Issue#193
335-
'Description' : '',
336-
'Validator' : lambda value: _scale_padding_validator(value) },
337-
338344
'ax' : { 'Default' : None,
339345
'Description' : 'Matplotlib Axes object on which to plot',
340346
'Validator' : lambda value: isinstance(value,mpl_axes.Axes) },

0 commit comments

Comments
 (0)