Movatterモバイル変換


[0]ホーム

URL:


You are reading an old version of the documentation (v2.0.0). For the latest version seehttps://matplotlib.org/stable/
matplotlib

Navigation


Travis-CI:

Related Topics

This Page

Quick search

style_sheets example code: plot_fivethirtyeight.py

(Source code,png,pdf)

../../_images/plot_fivethirtyeight.png
"""===========================FiveThirtyEight style sheet===========================This shows an example of the "fivethirtyeight" styling, whichtries to replicate the styles from FiveThirtyEight.com."""frommatplotlibimportpyplotaspltimportnumpyasnpplt.style.use('fivethirtyeight')x=np.linspace(0,10)# Fixing random state for reproducibilitynp.random.seed(19680801)fig,ax=plt.subplots()ax.plot(x,np.sin(x)+x+np.random.randn(50))ax.plot(x,np.sin(x)+0.5*x+np.random.randn(50))ax.plot(x,np.sin(x)+2*x+np.random.randn(50))ax.plot(x,np.sin(x)-0.5*x+np.random.randn(50))ax.plot(x,np.sin(x)-2*x+np.random.randn(50))ax.plot(x,np.sin(x)+np.random.randn(50))ax.set_title("'fivethirtyeight' style sheet")plt.show()

Keywords: python, matplotlib, pylab, example, codex (seeSearch examples)

© Copyright 2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012 - 2016 The Matplotlib development team. Last updated on Feb 20, 2017. Created usingSphinx 1.5.2.

[8]ページ先頭

©2009-2025 Movatter.jp