[SciPy-dev] help with plot directive in scipy.stats.tutorial

Ralf Gommers ralf.gommers@googlemail....
Tue Aug 25 20:10:46 CDT 2009

On Tue, Aug 25, 2009 at 4:39 PM, <josef.pktd@gmail.com> wrote:

> Since the stats.tutorial has now been merged into svn, I would like to
> clean up the plot directives. When I wrote this initially, I didn't
> realize that the plot commands do not have access to previously
> defined variables.

> I would like to replace the current code with plot directives using
> script files instead of the inline plot directive. Because, I'm
> currently not able or setup to build the docs, I would like to know if
> this is ok or whether someone can test this.

Hi Josef, I can't answer your question but if it works it seems like a clean

If you are cleaning up those plot directives would you mind using the
pep8.py script? I read the stats tutorial before and I like the content, but
it would be much more readable if the lines were <80 characters and the
whitespace issues were fixed. I tried it on one of your attached scripts and
it catches quite a few errors:

ralf@ralf-desktop:~/Desktop$ python pep8.py --repeat normdiscr_plot2.py
normdiscr_plot2.py:10:27: E231 missing whitespace after ','
normdiscr_plot2.py:16:51: E231 missing whitespace after ','
normdiscr_plot2.py:18:1: W291 trailing whitespace
normdiscr_plot2.py:23:2: E231 missing whitespace after ','
normdiscr_plot2.py:24:27: E231 missing whitespace after ','
normdiscr_plot2.py:25:13: E231 missing whitespace after ','
normdiscr_plot2.py:26:13: E231 missing whitespace after ','
normdiscr_plot2.py:27:13: E231 missing whitespace after ','
normdiscr_plot2.py:28:13: E231 missing whitespace after ','
normdiscr_plot2.py:29:45: E222 multiple spaces after operator
normdiscr_plot2.py:39:80: E501 line too long (83 characters)
normdiscr_plot2.py:39:58: E231 missing whitespace after ','
normdiscr_plot2.py:43:26: E202 whitespace before ')'
normdiscr_plot2.py:44:12: E201 whitespace after '('

There is more that the script does not catch, like whitespace issues around
'=' and operators, but it definitely helps.


> The attached files are my original scripts, I haven't really reviewed
> it just checked that they work.

> Thanks,
> Josef
> .. plot:: examples/normdiscr_plot1.py
>   :align: center
>   :include-source: 0
> .. plot:: examples/normdiscr_plot2.py
>   :align: center
>   :include-source: 0
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20090825/183c7f39/attachment.html 

More information about the Scipy-dev mailing list