def create_time_line(self, axes, t, y, time_value, label):
"""
creates a vertical line in the diagram, reaching from the x-axis to the plot at a given time t
:param axes:
:param t:
:param y:
:param time_value:
:param label:
:returns new counter value
"""
# don't create lines on the very left
if time_value == t[-1]:
return
# create timeLine
time_line = Line2D([time_value, time_value],
[np.min(y), y[t.index(time_value)]],
ls=self.line_style,
c=self.line_color)
axes.add_line(time_line)
axes.text(time_value + self.spacing, self.label_posistions[self.label_counter], label, size=self.font_size)
评论列表
文章目录