Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


broken links in the gallery #1024

merged 1 commit into from

3 participants


the following links in the gallery
(and maybe others) do not work

1. Server:
2. URL path: /examples/pylab_examples/demo_tight_layout_00.html
3. Error notes: NONE
4. Error type: 404
5. Request method: GET
6. Request query string: NONE
7. Time: 2012-07-19 09:12:32 UTC (1342689152)

The corresponding links in the examples (e.g. are fine


Confirmed in master as well. Not sure where these are coming from because the string "demo_tight_layout_00" doesn't exist in any of the version-controlled files.


The attached pull request resolves this issue. I am now going to upload a fixed version of the 1.1.x docs based on this change.


I think your fix would also solve a few other problems I have had as well (left over .pyc files get picked up sometimes), unless I am completely mis-understanding the regex.


I don't think it will address that, because it's only use with things before the extension. All it really addresses is that some of the examples produce multiple groups of figures, and those were not getting correctly linked back to the single .py that produced them.

Go ahead and file another bug if you're seeing something related to left over .pyc files.

@mdboom mdboom merged commit ff883a6 into from
@mdboom mdboom deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 3, 2012
  1. @mdboom

    Fix gallery links (#1024)

    mdboom authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 5 deletions.
  1. +2 −5 doc/sphinxext/
7 doc/sphinxext/
@@ -16,7 +16,7 @@
import os, glob, re, sys, warnings
import matplotlib.image as image
-multiimage = re.compile('(.*)_\d\d')
+multiimage = re.compile('(.*?)(_\d\d){1,2}')
def make_thumbnail(args):
image.thumbnail(args[0], args[1], 0.3)
@@ -68,11 +68,8 @@ def gen_gallery(app, doctree):
thumbnails[orig_path] = thumb_path
m = multiimage.match(basename)
- if m is None:
- pyfile = ''%basename
- else:
+ if m is not None:
basename =
- pyfile = ''%basename
data.append((subdir, basename,
os.path.join(rootdir, subdir, 'thumbnails', filename)))
Something went wrong with that request. Please try again.