What setup do you need for Python Visualizations in Power BI? Any particular matplotlib package versions or system settings?

浪尽此生 提交于 2019-12-08 17:04:47

OK now it's obvious where the error comes from.

In the line (which Power BI generates on the fly):

matplotlib.pyplot.figure(figsize=(5,87473572938689,6,87403100775194))

It grabs the dimensions in your locale (which in this case use ',' as decimal point) and passes it to figsize.

While figsize accepts a tuple of (width, height) in inches as input, 5,87473572938689,6,87403100775194 is treated as 4 arguments, instead of 2, which causes the error.


So to work around this, you can either explicitly pass figsize (using values with . as decimal point) to plt.figure, i.e.:

import matplotlib.pyplot as plt
plt.figure(figsize=(5.874,6.874))
plt.plot(dataset['Date'], dataset['Value'])
plt.show()

Or change the locale in Power BI to one which use . as decimal points instead of ,.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!