Note

Go to the endto download the full example code.

Dark background style sheet#

This example demonstrates the "dark_background" style, which uses white forelements that are typically black (text, borders, etc). Note that not all plotelements default to colors defined by an rc parameter.

'dark_background' style sheet
importmatplotlib.pyplotaspltimportnumpyasnpplt.style.use('dark_background')fig,ax=plt.subplots()L=6x=np.linspace(0,L)ncolors=len(plt.rcParams['axes.prop_cycle'])shift=np.linspace(0,L,ncolors,endpoint=False)forsinshift:ax.plot(x,np.sin(x+s),'o-')ax.set_xlabel('x-axis')ax.set_ylabel('y-axis')ax.set_title("'dark_background' style sheet")plt.show()

Gallery generated by Sphinx-Gallery