Disabeling entries in the legend
05 August 2016
The keyword '_nologend_' prevents a plot to show up in the legend of matplotlib figure
import numpy as np
import matplotlib.pyplot as plt
x1,y1 = np.random.rand(2,10)
x2,y2 = np.random.rand(2,10)
x3,y3 = np.random.rand(2,10)
x4,y4 = np.random.rand(2,10)
plt.plot(x1, y1, label='Test 1')
plt.plot(x2, y2) #No label, so no legend text
plt.plot(x3, y3, label='_nolegend_') # Activ no legend text
plt.plot(x4, y4, label='Test 4')
plt.legend() # legend with entries from the first and fourth plot