5

Anaconda 5.1, matplotlib 2.2.2 on Win 10 x64

matplotlib\mpl-data\sample_data is missing from matplotlib package so a number of samples and tutorials that expect to load them with matplotlib.cbook.get_sample_data() fails.

Tried to install mpl_sample_data package from conda-forge but files are installed into the parent directory matplotlib\mpl-data and not matplotlib\mpl-data\sample_data where they should be and get_sample_data() expects to find them as default.

Any suggestion on how to have a complete matplotlib installation on Anaconda?

Thanks

Gabriele
  • 73
  • 1
  • 4

3 Answers3

1

Here's my solution. First, I install matplotlib package independently using the official command 'python -mpip install -U matplotlib'. https://matplotlib.org/2.2.2/users/installing.html#windows Then, you will have the sample_data folder in your Python directory. Second, I copy the sample_data folder from Python directory to anaconda's matplotlib\mpl-data\ directory.

redcreek
  • 11
  • 1
0

Never mind. I see that Anaconda recipe for matplotlib explicitly exclude sample_data, i don't understand why, but instead of bothering with packages i simply downloaded matplotlib from github and used sample_data from it.

Gabriele
  • 73
  • 1
  • 4
0

Installed matplotlib using anaconda, facing the same Problem. This worked for me, copy the following folder sample_data in your anaconda installation viz.,

C:\ProgramData\Anaconda3\Lib\site-packages\matplotlib\mpl-data\

(I've installed it in C drive).

Or better still you can clone matplotlib repository from git and then install using command:

python setup.py install

Hope this helps.

Vishal R
  • 1,279
  • 1
  • 21
  • 27