1

我尝试使用 beeswarm 用以下代码绘制一些数据:

import beeswarm
from beeswarm import *
import numpy as np

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

然后错误来了:

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

有谁知道如何处理这个问题?先感谢您。

4

1 回答 1

0

确保您已安装 pybeeswarm。这对我有用:

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

d = np.array([0,1,2,3,4])
beeswarm([d])
plt.show()
于 2018-10-30T07:13:54.703 回答