Skip to content

Commit e5596e5

Browse files
committed
change vline
1 parent 591c81c commit e5596e5

File tree

1 file changed

+22
-25
lines changed

1 file changed

+22
-25
lines changed

src/mplfinance/plotting.py

+22-25
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def _valid_plot_kwargs():
260260
'Validator' : lambda value: _hlines_validator(value) },
261261

262262
'vlines' : { 'Default' : None,
263-
'Description' : 'Draw one or more VERTICAL LINES across entire plot, by'+
263+
'Description' : 'Draw VERTICAL LINES across one plot, by'+
264264
' specifying a date[time], or sequence of date[time]. May also'+
265265
' be a dict with key `vlines` specifying a date[time] or sequence'+
266266
' of date[time], plus one or more of the following keys:'+
@@ -532,7 +532,7 @@ def plot( data, **kwargs ):
532532
if ptype == 'line':
533533
lw = config['_width_config']['line_width']
534534
pmarkevery = config['markevery']
535-
axA1.plot(xdates, closes, 'o', markevery=pmarkevery, ls='-', color=config['linecolor'], linewidth=lw, )
535+
axA1.plot(xdates, closes, 'o', markevery=pmarkevery, ls='-', color=config['linecolor'], linewidth=lw )
536536
else:
537537
collections =_construct_mpf_collections(ptype,dates,xdates,opens,highs,lows,closes,volumes,config,style)
538538
if ptype in VALID_PMOVE_TYPES:
@@ -656,31 +656,28 @@ def plot( data, **kwargs ):
656656
tlines = [tlines,]
657657
for tline_item in tlines:
658658
line_collections.append(_construct_tline_collections(tline_item, dtix, dates, opens, highs, lows, closes))
659-
### note
660-
# if config['addplot'] is not None:
661-
# for panid,row in panels.iterrows():
662-
# print(panid)
663-
# print("the value of min and max is ",miny,maxy)
664-
# print("type of row is ", type(row))
665-
# print("panid is ",panid)
666-
# print("row key is ",row.keys())
667-
# ax = row['axes']
668-
# line_collections = []
669-
# if (panid == 0):
670-
# line_collections.append(_construct_vline_collections(config['vlines'], dtix, miny, maxy))
671-
# else:
672-
# line_collections.append(_construct_vline_collections(config['vlines'], dtix, 200, 600))
673-
674-
# for collection in line_collections:
675-
# if collection is not None:
676-
# ax[0].add_collection(collection)
677-
if config['addplot'] is not None:
659+
660+
vlinelist = config['vlines']
661+
662+
if config['addplot'] is not None and vlinelist is not None:
678663
for panid,row in panels.iterrows():
679664
ax = row['axes']
680-
print(dtix)
681-
print(config['vlines'])
682-
# _date_to_iloc
683-
ax[0].axvline(x=50.5,linestyle='--')
665+
666+
# print("the type of vlinelist is ",type(vlinelist))
667+
668+
# print(vlinelist)
669+
# print(vlinelist['vlines'])
670+
671+
# for line in vlinelist['vlines']:
672+
# print("the line is ",line)
673+
# print("the line is type ",type(line))
674+
675+
# print("the data type is ",type(data))
676+
# print("the data type is ",data.columns)
677+
# ax[0].axvline(x=data.loc[str(line)],linestyle='--')
678+
ax[0].axvline(x=50,linestyle='--')
679+
680+
684681
else:
685682
for collection in line_collections:
686683
if collection is not None:

0 commit comments

Comments
 (0)