| CARVIEW |
Select Language
HTTP/2 301
date: Tue, 30 Dec 2025 17:45:04 GMT
content-length: 0
location: /2.0.2/examples/style_sheets/plot_fivethirtyeight.html
server: cloudflare
cf-cache-status: DYNAMIC
strict-transport-security: max-age=15552000; preload
x-content-type-options: nosniff
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=Wl4Gd%2BK7hNdkkzk456wvoiGxHuxkDha2PVtPTtWOgr7Hyt0n9%2FiLMXXXc7%2FwF9HJ384xnnLJJDwhVTq7EuCYAiBNCrdgJ%2Fe94TGo0FI%3D"}]}
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
expect-ct: max-age=86400, enforce
referrer-policy: same-origin
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
cf-ray: 9b6359470c5b165e-BLR
HTTP/2 200
date: Tue, 30 Dec 2025 17:45:04 GMT
content-type: text/html; charset=utf-8
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
last-modified: Fri, 14 Feb 2025 03:28:43 GMT
server: cloudflare
vary: Accept-Encoding
cf-cache-status: DYNAMIC
strict-transport-security: max-age=15552000; preload
x-content-type-options: nosniff
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=r6YZinswVPV2DJbbCr2hvFBX4U0igHd9t5RqVFeurZwFUuP9taD5Wv7fQ2ICWJHdVgUTzG8DGxjCoCQafysQugPXOZnTpwuXMgJotvU%3D"}]}
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
expect-ct: max-age=86400, enforce
referrer-policy: same-origin
content-encoding: gzip
cf-ray: 9b635948be0b165e-BLR
style_sheets example code: plot_fivethirtyeight.py — Matplotlib 2.0.2 documentation
You are reading an old version of the documentation (v2.0.2). For the latest version see https://matplotlib.org/stable/
Navigation
style_sheets example code: plot_fivethirtyeight.pyΒΆ
(Source code, png, pdf)
"""
===========================
FiveThirtyEight style sheet
===========================
This shows an example of the "fivethirtyeight" styling, which
tries to replicate the styles from FiveThirtyEight.com.
"""
from matplotlib import pyplot as plt
import numpy as np
plt.style.use('fivethirtyeight')
x = np.linspace(0, 10)
# Fixing random state for reproducibility
np.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 (see Search 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 May 10, 2017.
Created using Sphinx 1.5.5.