you can use
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
if you dont want to use tkinter
at all.
Also dont forget to use %matplotlib inline
at the top of your notebook if using one.
EDIT: agg
is a different backend like tkinter
for matplotlib.