|
15 | 15 |
|
16 | 16 | from mplfinance._arg_validators import _process_kwargs, _validate_vkwargs_dict |
17 | 17 | from mplfinance._arg_validators import _alines_validator, _bypass_kwarg_validation |
| 18 | +from mplfinance._arg_validators import _xlim_validator, _is_datelike |
18 | 19 | from mplfinance._styles import _get_mpfstyle |
19 | 20 |
|
20 | 21 | from six.moves import zip |
@@ -75,7 +76,7 @@ def _check_and_convert_xlim_configuration(data, config): |
75 | 76 | if not _xlim_validator(xlim): |
76 | 77 | raise ValueError('Bad xlim configuration #1') |
77 | 78 |
|
78 | | - if all([_is_date_like(dt) for dt in xlim]): |
| 79 | + if all([_is_datelike(dt) for dt in xlim]): |
79 | 80 | if config['show_nontrading']: |
80 | 81 | xlim = [ _date_to_mdate(dt) for dt in xlim] |
81 | 82 | else: |
@@ -222,8 +223,10 @@ def _date_to_iloc(dtseries,date): |
222 | 223 | return (loc1+loc2)/2.0 |
223 | 224 |
|
224 | 225 | def _date_to_iloc_linear(dtseries,date,trace=False): |
225 | | - '''Find the slope and yintercept for the line: |
226 | | - iloc = (slope)*(date) + (yintercept) |
| 226 | + '''Find the location of a date using linear extrapolation. |
| 227 | + Use the endpoints of `dtseriews` to the slope and yintercept |
| 228 | + for the line: iloc = (slope)*(dtseries) + (yintercept) |
| 229 | + The use them to calculate the location of `date` |
227 | 230 | ''' |
228 | 231 | d1 = _date_to_mdate(dtseries.index[0]) |
229 | 232 | d2 = _date_to_mdate(dtseries.index[-1]) |
|
0 commit comments