Issue
I am trying to plot the transparent graph, but some boxes are appearing in the background and outer frame is not coming. How can I remove the white background from the plot and make it transparent and put outer frame?
from matplotlib import pyplot
pyplot.scatter(Neural_Net, y_test)
pyplot.xlabel('Actual', fontsize=15)
pyplot.ylabel('Predicted', fontsize=15)
pyplot.show()
Solution
The default matplotlib
style
is classic
You can see available 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']
To change back to the default white background:
plt.style.use('classic')
Hopefully that helps!
Answered By - JA-pythonista
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.