import matplotlib.pyplot as plt
def plot_arrow(arrow_type):
if arrow_type == 'good_arrow':
arrow_color = 'g'
ar = plt.arrow(x, y, dx , dy, label=arrow_type, fc=arrow_color)
plt.legend([ar,], [arrow_type,])
The above callback function is used to draw arrows in a plot. I need to add legend to them. These arrows are drawn dynamically. The above code will have only one legend. I tried solutions like this but those do not work for matplotlib.pyplot.arrow
Edit:
Problem: I have two colored arrows but only one legend