vivekhsridhar/tracktor

NameError: name 'plt' is not defined

lanec-unifesspa opened this issue · 1 comments

I'm trialing tracktor on a machine running Xubuntu 16.04, on a jupyter notebook. When running the fish example, everything seems to be going smoothly, except when I try to plot (last section). In that case, the following output error is produced:


NameError Traceback (most recent call last)
in ()
----> 1 plt.scatter(df['time'][index], df['cum_dist'][index], c='#FF7F50', s=8, alpha=0.5)
2 plt.xlabel('Time (s)')
3 plt.ylabel('Cumulative distance (cm)')
4 plt.tight_layout()
5 plt.savefig('imgs/ex1_fig2a.eps', format='eps', dpi=300)

NameError: name 'plt' is not defined

I believe this is a matplotlib issue (see, e.g., konstantint/matplotlib-venn#33). How can it be corrected?

Are you running an example notebook?
plt is defined when you say import matplotlib.pyplot as plt