-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Closed
Description
For example (in pylab mode):
c = ['#0091D3', '#D41621', '#009737', '#FE6C19']
x = arange(10)
for z in range(4):
plot(polyfit(x, random.random(10), 1), color=c[z], lw=2)
A = Line2D((0,1),(0,0), color=c[0], lw=2)
B = Line2D((0,1),(0,0), color=c[1], lw=2)
C = Line2D((0,1),(0,0), color=c[2], lw=2)
D = Line2D((0,1),(0,0), color=c[3], lw=2)
legend((A, B, C, D), ('A', 'B', 'C', 'D'), loc=2)result:
but if I name Line2D variables like this:
A2 = Line2D((0,1),(0,0), color=c[0], lw=2)
B2 = Line2D((0,1),(0,0), color=c[1], lw=2)
A1 = Line2D((0,1),(0,0), color=c[2], lw=2)
B1 = Line2D((0,1),(0,0), color=c[3], lw=2)
legend((A2, B2, A1, B2), ('A2', 'B2', 'A1', 'B1'), loc=2)I get incorrect color for last line:
Latest stable MPL on Windows
Metadata
Metadata
Assignees
Labels
No labels

