Power BI仅显示Matplotlib修补程序集合中的一个修补程序

时间:2020-06-14 05:17:44

标签: python matplotlib powerbi

我正在尝试在Power BI(桌面)中显示matplotlib图。它包括Patchcollection。运行独立的python代码可以做到:

enter image description here

但是在Power BI中,相同的代码导致以下结果:

enter image description here

附加示例代码:

from matplotlib import pyplot as plt
from matplotlib.patches import Rectangle
from matplotlib.patches import Circle
import matplotlib.collections
import numpy as np

N = dataset.shape[0]
patches = []

# code to fill in the list patches goes here

fig = plt.figure()
ax = fig.add_subplot(111, aspect='equal')
colors = 100*np.random.random(N)
p = matplotlib.collections.PatchCollection(patches, cmap=matplotlib.cm.jet, alpha=0.4)
p.set_array(colors)
ax.add_collection(p)
plt.autoscale(enable='True', axis='both')

plt.show()

任何帮助将不胜感激。谢谢!

编辑:刚刚注意到,该单个补丁的值增加了一倍。很奇怪。

1 个答案:

答案 0 :(得分:0)

找出问题所在。我必须在每个字段的值标签中选择“不汇总”。