numpy 从matplotlib图形中删除白色背景

ijnw1ujt  于 12个月前  发布在  其他
关注(0)|答案(1)|浏览(99)

我试图绘制透明图,但一些框出现在背景中,外框没有出现。我怎样才能从图中去掉白色背景,使其透明并放入外框?

from matplotlib import pyplot
pyplot.scatter(Neural_Net, y_test)
pyplot.xlabel('Actual', fontsize=15)
pyplot.ylabel('Predicted', fontsize=15)
pyplot.show()

b5buobof

b5buobof1#

默认的matplotlibstyleclassic
您可以看到可用的matplotlib styles

import matplotlib.pyplot as plt

#To list all available styles, use:

print(plt.style.available)
['Solarize_Light2', '_classic_test_patch', 'bmh', 'classic', 'dark_background', 'fast', 'fivethirtyeight', 'ggplot', 'grayscale', 'seaborn', 'seaborn-bright', 'seaborn-colorblind', 'seaborn-dark', 'seaborn-dark-palette', 'seaborn-darkgrid', 'seaborn-deep', 'seaborn-muted', 'seaborn-notebook', 'seaborn-paper', 'seaborn-pastel', 'seaborn-poster', 'seaborn-talk', 'seaborn-ticks', 'seaborn-white', 'seaborn-whitegrid', 'tableau-colorblind10']

要改回默认的白色背景,请执行以下操作:

plt.style.use('classic')

希望这有帮助!

相关问题