PDF (but not screen) output raises "Path lacks initial MOVETO"

I had a closer look at an issue raised previously
(http://old.nabble.com/can't-output-emf-pdf-eps-figure-file-corrently-with-my-dataset.-to31104695.html#a31107307),
because I found out where the problem lies: when plotting a figure in log
scale with some null values, screen plots display fine (Mac OS X backend);
however, when trying to save the figure (with savefig) to PDF, a "Path lacks
initial MOVETO" exception is raised (it looks like this may be related to
the way masked values are handled by both backends).

It would be better if Matplotlib's backends were consistent, here (i.e. if
it failed both on screen and when generating the PDF, or if it did not fail
at all).

I attach a slightly modified version of the original program:
http://old.nabble.com/file/p32470066/t.py t.py . Commenting out the
savefig() call makes the program work nicely (Mac OS X backend, MacPort's
Matplotlib 1.0.1).

···

--
View this message in context: http://old.nabble.com/PDF-(but-not-screen)-output-raises-"Path-lacks-initial-MOVETO"-tp32470066p32470066.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

I can replicate the bug on the 1.0.1 release branch but not on master,
so it appears to have been fixed, but I am not sure which commit is
responsible for the fix. Look for the fix in the next release, or
upgrade from github if you need a fix sooner.

Thanks for the report,
JDH

···

On Thu, Sep 15, 2011 at 4:03 AM, Eric O LEBIGOT (EOL) <Eric.Lebigot@...1818...> wrote:

It would be better if Matplotlib's backends were consistent, here (i.e. if
it failed both on screen and when generating the PDF, or if it did not fail
at all).

I attach a slightly modified version of the original program:
http://old.nabble.com/file/p32470066/t.py t.py . Commenting out the
savefig() call makes the program work nicely (Mac OS X backend, MacPort's
Matplotlib 1.0.1).

John Hunter-4 wrote:

It would be better if Matplotlib's backends were consistent, here (i.e.
if
it failed both on screen and when generating the PDF, or if it did not
fail
at all).

I attach a slightly modified version of the original program:
http://old.nabble.com/file/p32470066/t.py t.py . Commenting out the
savefig() call makes the program work nicely (Mac OS X backend, MacPort's
Matplotlib 1.0.1).

I can replicate the bug on the 1.0.1 release branch but not on master,
so it appears to have been fixed, but I am not sure which commit is
responsible for the fix. Look for the fix in the next release, or
upgrade from github if you need a fix sooner.

Thanks for the report,
JDH

Thanks, John. Looking forward to the next release. :slight_smile:

···

On Thu, Sep 15, 2011 at 4:03 AM, Eric O LEBIGOT (EOL) > <Eric.Lebigot@...1818...> wrote:

--
View this message in context: http://old.nabble.com/PDF-(but-not-screen)-output-raises-"Path-lacks-initial-MOVETO"-tp32470066p32472380.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

I was able to confirm this bug with 1.0.1, but it has already been fixed in git master. This fix should make it into the next release.

I used "git bisect" to track down the point at which it was fixed and turned up this:

   https://github.com/matplotlib/matplotlib/commit/6fe5fa03e8608949cb08a485a4d6adf9247a5ffb

Unfortunately, that won't apply cleanly to 1.0.1, so I can't recommend a quick fix other than updating to git master.

Mike

···

On 09/15/2011 05:03 AM, Eric O LEBIGOT (EOL) wrote:

I had a closer look at an issue raised previously
(http://old.nabble.com/can't-output-emf-pdf-eps-figure-file-corrently-with-my-dataset.-to31104695.html#a31107307),
because I found out where the problem lies: when plotting a figure in log
scale with some null values, screen plots display fine (Mac OS X backend);
however, when trying to save the figure (with savefig) to PDF, a "Path lacks
initial MOVETO" exception is raised (it looks like this may be related to
the way masked values are handled by both backends).

It would be better if Matplotlib's backends were consistent, here (i.e. if
it failed both on screen and when generating the PDF, or if it did not fail
at all).

I attach a slightly modified version of the original program:
http://old.nabble.com/file/p32470066/t.py t.py . Commenting out the
savefig() call makes the program work nicely (Mac OS X backend, MacPort's
Matplotlib 1.0.1).