You are reading an old version of the documentation (v1.4.3). For the latest version see https://matplotlib.org/stable/

We're updating the default styles for Matplotlib 2.0

Learn what to expect in the new updates

matplotlib

Previous topic

misc example code: rec_join_demo.py

Next topic

misc example code: svg_filter_line.py

This Page

misc example code: sample_data_demo.pyΒΆ

[source code]

"""
Grab mpl data from the ~/.matplotlib/sample_data cache if it exists, else
fetch it from github and cache it
"""
from __future__ import print_function
import matplotlib.cbook as cbook
import matplotlib.pyplot as plt
fname = cbook.get_sample_data('ada.png', asfileobj=False)

print('fname', fname)
im = plt.imread(fname)
plt.imshow(im)
plt.show()

Keywords: python, matplotlib, pylab, example, codex (see Search examples)