Skip to content
Advertisement

Change plot background color in jupyter notebook

How can I change the grey color in the background to white color?

mydata.plot()

plot

Advertisement

Answer

import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0, 10, .1)
y = np.sin(x)
plt.figure(facecolor='yellow')
plt.plot(x, y)
plt.xlabel("X")
ax = plt.axes()
ax.set_facecolor("violet")
plt.ylabel('sin(x)')
plt.show()

it make it yellow my freind

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement