konstantint / matplotlib-venn

Area-weighted venn-diagrams for Python/matplotlib
MIT License
519 stars 68 forks source link

plt is not defined #33

Closed tommycarstensen closed 7 years ago

tommycarstensen commented 7 years ago

I get this this error:

NameError: name 'plt' is not defined

With this code:

import matplotlib_venn
matplotlib_venn.venn2((set((1, 2, 3)), set((3, 4, 5))))
plt.savefig('test.png')

I also tried the given example:

set1 = set(['A', 'B', 'C', 'D'])
set2 = set(['B', 'C', 'D', 'E'])
set3 = set(['C', 'D',' E', 'F', 'G'])

venn3([set1, set2, set3], ('Set1', 'Set2', 'Set3'))
plt.show()
konstantint commented 7 years ago

There is a commonly implied convention that you do

from matplotlib import pyplot as plt

somewhere in your code.

MohammadHeydari commented 5 years ago

Works fine

vidyasastri-421 commented 4 years ago

plt.figure(figsize=(8, 6))

time series plot

sns.tsplot(df_time) plt.xlabel("Time") plt.ylabel("Sales") plt.show()

for this code am getting the error name plt is not defined

konstantint commented 4 years ago

Check out my previous comment in this thread.