Je trace une boîte à moustaches à l'aide de Python dans Power BI. J'ai défini la couleur d'arrière-plan de la page de rapport Power BI sur jaune et j'essaie de définir la couleur d'arrière-plan du visuel python. J'ai actuellement le code suivant.
matplotlib.rc('axes', facecolor = 'red') dataset.boxplot(column='daily_return', by='name', grid=False, figsize=(15,4)) matplotlib.pyplot.title('') matplotlib.pyplot.suptitle('') matplotlib.pyplot.xlabel('') matplotlib.pyplot.show()
Le code ci-dessus donne l'image suivante ...
Comme on peut le voir, il y a encore un espace blanc. Comment faire pour que cela devienne rouge, que je changerai éventuellement en couleur d'arrière-plan Power BI.
Si je peux rendre l'arrière-plan transparent, ce serait mieux .
3 Réponses :
plt.rcParams['figure.facecolor'] = 'Red' It will make the same color for complete fig.
Ce qui suit a fonctionné ...
matplotlib.rc('savefig', transparent = True)
plt.rcParams['savefig.facecolor'] = 'grey' Debbuged all parms and seen that Power Bi was displaying the rendered image then the live one.