Trying to visualize a grid using matplotlib and adding vertical lines in a cycle.
for element in new_gr_4:
axs.axvline(
x=element,
color = 'black',
linestyle = 'dashed',
linewidth = 1.0,
alpha=0.5,
label='new_grid 4 (weighted)'
)
If I am trying to show a legend for a plot - I have a lot of elements in a legend with the same visualization parameters (because I have added them in a cycle multiple times).
Is it possible to add a label on a legend for a group, only once?
Or how to add add a separate label on a legend for provided visualization parameters?