Hi all,

I am trying to use the matplotlib plot_directive.py and am running into 
couple problems and errors:

1. Multiple plotting functions

My plot.py generates multiple plots. They are all generated and displayed 
fine if  it is just a one large script, i.e.

fig = p.figure()
ax = fig.add_subplot(111)
ax.plot()

fig1 = p.figure()
ax1 = fig1.add_subplot(111)
ax1.plot()

....

when I try something:

def fig0():
    fig = p.figure()
    ax = fig.add_subplot(111)
    ax.plot()

def fig1():
    fig1 = p.figure()
    ax1 = fig1.add_subplot(111)
    ax1.plot()

and use

.. plot:: plots/plot.py fig0

.. plot:: plots/plot.py fig1

It only generates fig0 twice. Am I doing something wrong or is this to be 
expected?

2. Caption errors

When I try to add a caption to my plots this way:

.. plot:: plots/plot.py
   
   CAPTION

I get the error

File 
"/Users/xxx/Library/Python/2.7/lib/python/site-packages/matplotlib/sphinxext/plot_directive.py",
 
line 598, in run
    raise RuntimeError("plot:: directive can't have both args and content")
RuntimeError: plot:: directive can't have both args and content
The full traceback has been saved in 
/var/folders/qk/13wddwdn7hd2_7hdtlqfz7s80000gn/T/sphinx-err-CvlaJh.log, if 
you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error 
message can be provided next time.
Either send bugs to the mailing list at 
<http://groups.google.com/group/sphinx-dev/>,
or report them in the tracker at 
<http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!
make: *** [html] Error 1

while when I use 

.. plot:: plots/plot.py
   CAPTION

No caption appears. What should I do?

Thanks a lot in advance.

Cheers,

Benedikt

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sphinx-dev/-/mydrZlqhy1sJ.
To post to this group, send email to sphinx-dev@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to