Installing matplotlib documentation

Continued from github:

I am inside matplotlib/doc/ when I do the make html.

What are the contents of doc/Makefile? How did you get the source tree?

Actually there seems to be no Makefile there…

How did you get the source tree? You should clone the github repo.

Could you please follow the matplotlib contribution doc page linked in the post? I followed it but apparently over time the file structure seems to have changed and the (old) doc instructions doesn’t work anymore.

The link is:

You should be using these instructions:

if they don’t work, please let us know.

From what I see, the documentation looks same. Issue I notice is that there is no makefile in the doc folder

Can some developers make a fresh pull and verify if documentation is up to date?

The file exists in the git tree:

1 Like

Sorry to bother, but there is no Makefile file inside matplotlib/doc/ inside the repo pulled from github. Shouldn’t there be a Makefile there?

Confirming what @tacaswell posted, I’m also seeing the file in the current tree

Can you print the output of git remote --verbose

origin (fetch)
origin (push)

That fork of Matplotlib is a couple of years out of date, which is why the current install instructions are not matching up with the code in the repository. You’re going to want to update your fork to a current version of the code.

git remote add upstream
git fetch upstream master
git merge upstream/master

You can find more detailed instructions at

1 Like

Thanks! I am now able to start building html but having issue at following location (

generating gallery for gallery/images_contours_and_fields... [ 45%]                                                                                                             
Exception occurred:
  File "/home/sathish/anaconda3/lib/python3.7/site-packages/matplotlib/", line 469, in _make_image
    if alpha is not None and alpha != 1.0:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

The following was the header from the log file:

# Sphinx version: 2.2.1
# Python version: 3.7.5 (CPython)
# Docutils version: 0.15.2 release
# Jinja2 version: 2.10.3

I could not exactly understand the error due to the alpha values. I wonder if there needs to be modification to or should I change the version of the python that I am using to compile the doc?

What version of Matplotlib and numpy are you building the docs against?

>>> matplotlib._ _ version _ _

>>> numpy._ _ version _ _

matplotlib seems too old for me. I am updating both matplotlib and numpy.

I updated the matplotlib to 3.1.2. Still there is issue with the same gallery example. This time however the error message is slightly different but still to do with alpha values. I am getting the following error message:

generating gallery for gallery/images_contours_and_fields... [ 45%]                                                                                                             
Exception occurred:
  File "/home/sathish/anaconda3/lib/python3.7/site-packages/matplotlib/", line 530, in _make_image
    np.asarray(alpha_channel, np.float32) * out_alpha * alpha,
ValueError: operands could not be broadcast together with shapes (370,370) (100,100)

Inside your code repository, please type git log -1 and paste the output here/verify that you have a reasonably recent version of the code. If the last commit was within the last week or two, please try reinstalling from source using the instructions provided here:

1 Like