Where is the function get_example_data in matplotlib? It seems to be missing but its in examples/tutorials

Looking at this tutorial here: link text it references matplotlib.get_example_data('goog.npy'). I get an error when I run this, and furthermore I can't even find the mpl-data/ folder in my macosx installation of matplot lib when searching using Spotlight. Any idea what this function is now called?


Asked by: Agata147 | Posted: 06-12-2021






Answer 1

It's defined in __init__.py (around line 490), if that's what you're asking.

-- MarkusQ

P.S. The mpl_data/ directory is there too (both of them are in the top level directory). Are you sure you've got a good / complete installation?

Answered by: Michael446 | Posted: 07-01-2022



Answer 2

I just had a similar (the same?) problem for Ubuntu 10.04 (Python 2.6.5, MPL 0.99.1.1).

There was no get_sample_data, however a get_example_data in /usr/lib/pymodules/python2.6/matplotlib/__init__.py which didn't really work. The directory /usr/local/lib/python2.6/site-packages was empty.

As a workaround, I downloaded the file goog.npy directly and replaced the loading of the data with (probably similar)

with open("goog.npy") as f:
  r = np.load(f).view(np.recarray)

Answered by: Audrey308 | Posted: 07-01-2022



Similar questions

python - Tornado login Examples/Tutorials

Closed. This question does not meet Stack Overflow guid...






Still can't find your answer? Check out these communities...



PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python



top