We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c7835eb commit d3dd8dbCopy full SHA for d3dd8db
pandas/tools/plotting.py
@@ -149,6 +149,8 @@ def f(x):
149
result += (x_even * sin(harmonic * x) +
150
x_odd * cos(harmonic * x))
151
harmonic += 1.0
152
+ if len(amplitudes) % 2 != 0:
153
+ result += amplitudes[-1] * sin(harmonic * x)
154
return result
155
return f
156
def random_color(column):
@@ -167,9 +169,9 @@ def random_color(column):
167
169
f = function(row)
168
170
y = [f(t) for t in x]
171
label = None
- if class_col[i] not in used_legends:
- label = class_col[i]
172
- used_legends.add(class_col[i])
+ if str(class_col[i]) not in used_legends:
173
+ label = str(class_col[i])
174
+ used_legends.add(label)
175
ax.plot(x, y, color=random_color(class_col[i]), label=label)
176
ax.legend(loc='upper right')
177
ax.grid()
0 commit comments