Matplotlib: Remove line “dashes” and only display text in legend
问题 Created a legend and formatted the text as needed, but can't figure out how to remove the line "dashes" so that only text appears. Here's what I'm getting now (notice how the line is going through the text that is being right aligned): #Add legend leg = ax1.legend(bbox_to_anchor=(0.03, 1.05), prop={'size':8}) leg.get_frame().set_alpha(0) legText = pylab.gca().get_legend().get_texts() #Format legend text legText[0].set_color('#5998ff') legText[1].set_color('#ffbb82') legText[2].set_color('