0

some time ago I posted a question how to change the y-axis in a histogram, it all worked out that time. Now I am working on a barplot, which looks like this:

import seaborn as sns
plt.figure(figsize=(10,10))
sns.barplot(x="Hour", hue="Day", y="Änderung", data=df).set_title(a)
plt.ylim(-1, 6)
plt.show()

which should give me a barplot with fixed y-axis in the range of (-1,6), but somehow i get the error: TypeError: 'tuple' object is not callable.

When I skip the code plt.ylim(-1,6) the output looks like this:

enter image description here

What is my error?

Community
  • 1
  • 1
PV8
  • 5,799
  • 7
  • 43
  • 87

1 Answers1

0

It's impossible to know for sure, but the error implies that Python thinks plt.ylim is a tuple and not a function. It looks like you did someting like plt.ylim = (X,Y) somewhere above the lines you are showing, which replaced the function ylim() with a tuple (X,Y).

Usually, restarting the kernel should fix the issue

Diziet Asahi
  • 38,379
  • 7
  • 60
  • 75