![](/img/trans.png)
[英]Plot dynamically changing graph using matplotlib in Jupyter Notebook
[英]Changing the background color of plot on Jupyter using matplotlib
%matplotlib inline
plt.rcParams["figure.figsize"] = (8, 6)
plt.style.use("bmh")
plt.hist(np.random.normal(0,1, 10000), bins=100)
plt.gca().set_facecolor("white")
plt.setp(ax.spines.values(), color='k') # Change the frame border to black ('k')
使用ax
對象的另一種方法可能是
%matplotlib inline
plt.rcParams["figure.figsize"] = (8, 6)
plt.style.use("bmh")
fig, ax = plt.subplots()
ax.hist(np.random.normal(0,1, 10000), bins=100);
ax.set_facecolor("white")
plt.setp(ax.spines.values(), color='k')
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.