"TypeError: 'module' object is not callable" error when using beeswarm

580 views Asked by At

I am try to use beeswarm to plot some data with the follow codes:

import beeswarm
from beeswarm import *
import numpy as np

d = np.array([0,1,2,3,4])
beeswarm([d])

Then the error comes as:

Traceback (most recent call last):
  File "/home/sunyp/softwares/build/Anaconda2-5.1.0/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2882, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-21-26de9ff62f6f>", line 1, in <module>
    beeswarm([d1])
TypeError: 'module' object is not callable

Does anyone know how do deal with this problem? Thank you in advance.

1

There are 1 answers

0
user1394 On

Make sure you have pybeeswarm installed. This worked for me:

import matplotlib.pyplot as plt
from beeswarm import *
import numpy as np

d = np.array([0,1,2,3,4])
beeswarm([d])
plt.show()