Matplotlib-venn: plt is not defined

Created on 28 Sep 2017  路  4Comments  路  Source: konstantint/matplotlib-venn

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()

Most helpful comment

There is a commonly implied convention that you do

from matplotlib import pyplot as plt

somewhere in your code.

All 4 comments

There is a commonly implied convention that you do

from matplotlib import pyplot as plt

somewhere in your code.

Works fine

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

Check out my previous comment in this thread.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fgypas picture fgypas  路  6Comments

Achifaifa picture Achifaifa  路  9Comments

cledoux picture cledoux  路  13Comments

ajasja picture ajasja  路  17Comments

fgypas picture fgypas  路  6Comments