I have a Python custom visual inside a PowerBI report. Normally, this automatically fills the available space - and set the aspect ratio accordingly. However, when I set a facecolor
background color (say None
for a transparent visual, but also any other color), then the visual does not fill the space anymore, just keep the default matplotlib
aspect ratio. Any ideas on how to force the chart to autofill?
This renders correctly with autofill:
import matplotlib.pyplot as plt
plt.plot(dataset['Column1'],dataset['Column2'])
plt.show()
But this has the aspect ratio problem:
import matplotlib.pyplot as plt
plt.figure(facecolor='red')
plt.plot(dataset['Column1'],dataset['Column2'])
plt.show()