Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphinx plot extension source/build directory issues #157

Closed
ddale opened this issue Jun 20, 2011 · 2 comments
Closed

Sphinx plot extension source/build directory issues #157

ddale opened this issue Jun 20, 2011 · 2 comments

Comments

@ddale
Copy link
Contributor

ddale commented Jun 20, 2011

Original report at SourceForge, opened Wed Jun 16 02:16:45 2010

I'm trying to use the matplotlib Sphinx plot extension to add some diagrams to Sphinx documentation. However, I've come across an issue: My Sphinx documentation uses the "separate directories for source and build" option. It seems that the matplotlib plot extension doesn't work well with this option, because:

  1. I think the "pyplot" directory should be under the "source" directory. But I had to put it one level up from the "source" directory otherwise it wouldn't be found.

  2. When I try to build, I get error messages such as:
    /home/craig-nat/MySoftware/cobs-python/doc/source/index.rst:: WARNING: image file not readable: build/pyplots/cobsr_overhead.png
    It should be "../build/pyplots/cobsr_overhead.png" instead I think.

SourceForge Comments

On Sun Dec 5 16:22:05 2010, weegreenblobbie wrote:

This seems to be working in Matplotlib-1.0.0.

My Ubuntu box doesn't have 1.0.0 as a deb, so I downloaded the source an copied matplotlib-1.0.0/lib/matplotlib/sphinxext to my sphinx project.

I then updated my conf.py to use the copy:

Add any Sphinx extension module names here, as strings. They can be extensions

coming with Sphinx (named 'sphinx.ext.*') or your custom ones.

extensions =
[
'sphinxext.mathmpl',
'sphinxext.only_directives',
'sphinxext.plot_directive',
'sphinx.ext.autodoc',
'sphinx.ext.doctest'
]

And inlined plot directive work.

On Mon Jul 12 18:10:13 2010, None wrote:

I also got this bug with Sphinx 1.0b2, matplotlib 0.99.1.1

I was able to resolve it with two changes to matplotlib/sphinxext/plot_directive.py

Line 276:
from:
tmpdir = os.path.join('build', outdir)
to:
tmpdir = outdir

Line 320:
from:
for format in formats[1:]:
to:
for format in formats:

On Thu Jun 17 08:42:55 2010, cmcqueen1975 wrote:

Yes, Sphinx 1.0b2.

On Wed Jun 16 15:59:08 2010, mdboom wrote:

Which version of Sphinx? I believe you may get this message with Sphinx1.0b2.

@pelson
Copy link
Member

pelson commented Jun 18, 2012

Similar to #190 (although may be a different issue).

@efiring
Copy link
Member

efiring commented May 29, 2013

From the sourceforge comment, it sounds like this might be working; in any case, it is peripheral and inactive, so I am closing it.

@efiring efiring closed this as completed May 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants