I have a label list and I would like to use this list to mark points in graphs.
label_list = [
pd.to_datetime("2021-07-21"),
pd.to_datetime("2019-11-29"),
pd.to_datetime("2019-01-09"),
(pd.to_datetime("2020-03-31"), pd.to_datetime("2019-06-27")),
pd.to_datetime("2019-06-03"),
pd.to_datetime("2020-10-16"),
(pd.to_datetime("2021-01-04"), pd.to_datetime("2021-08-11")),
(pd.to_datetime("2021-05-08"), pd.to_datetime("2019-02-13")),
(pd.to_datetime("2020-06-11"), pd.to_datetime("2019-07-25"),pd.to_datetime("2018-11-27"))]
I have created 8 graphs using pyplot and for loop and saved them with
plt.savefig(r'...\Image_{0}.png'.format(i))
I have tried using list comprehension
[plt.axvline(_x, linewidth=1, color=colours) for _x in label_list]
but I keep getting "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()" Is there a way to do it?