ValueError: Can only output finite numbers in PDF

I can plot my semilogy plot fine to Qt5Agg backend, but switching to pdf
gave the error
ValueError: Can only output finite numbers in PDF

Of course I can workaround it, but it's inconsistent (and annoying).

That does sound annoying.

If you give a MSCWE, and a more complete backtrace, maybe it can be fixed. Probably better to just make a github issue (after searching if it already exists).

Cheers, Jody

···

On 20 Nov 2017, at 10:37 AM, Neal Becker <ndbecker2 at gmail.com> wrote:

I can plot my semilogy plot fine to Qt5Agg backend, but switching to pdf
gave the error
ValueError: Can only output finite numbers in PDF

Of course I can workaround it, but it's inconsistent (and annoying).

Being curious, MSCWE stands for?

Shawn

···

On Mon, Nov 20, 2017 at 10:47 AM, Jody Klymak <jklymak at uvic.ca> wrote:

On 20 Nov 2017, at 10:37 AM, Neal Becker <ndbecker2 at gmail.com> wrote:

I can plot my semilogy plot fine to Qt5Agg backend, but switching to pdf
gave the error
ValueError: Can only output finite numbers in PDF

Of course I can workaround it, but it's inconsistent (and annoying).

That does sound annoying.

If you give a MSCWE, and a more complete backtrace, maybe it can be fixed. Probably better to just make a github issue (after searching if it already exists).

Cheers, Jody

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

--
Yuxiang "Shawn" Wang, PhD
yw5aj at virginia.edu
+1 (434) 284-0836

I guess ?Minimal Self-Contained Working Example? (as a variation of
[SSCCE](http://www.sscce.org/), etc.)

Best,
Adrien

···

On 11/20/2017 11:38 AM, Yuxiang Wang wrote:

Being curious, MSCWE stands for?

Shawn

On Mon, Nov 20, 2017 at 10:47 AM, Jody Klymak <jklymak at uvic.ca> wrote:

On 20 Nov 2017, at 10:37 AM, Neal Becker <ndbecker2 at gmail.com> wrote:

I can plot my semilogy plot fine to Qt5Agg backend, but switching to pdf
gave the error
ValueError: Can only output finite numbers in PDF

Of course I can workaround it, but it's inconsistent (and annoying).

That does sound annoying.

If you give a MSCWE, and a more complete backtrace, maybe it can be fixed. Probably better to just make a github issue (after searching if it already exists).

Cheers, Jody

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

Ah got it. Thanks Adrien!

Shawn

···

On Mon, Nov 20, 2017 at 11:45 AM, vincent.adrien at gmail.com <vincent.adrien at gmail.com> wrote:

I guess ?Minimal Self-Contained Working Example? (as a variation of
[SSCCE](http://www.sscce.org/), etc.)

Best,
Adrien

On 11/20/2017 11:38 AM, Yuxiang Wang wrote:

Being curious, MSCWE stands for?

Shawn

On Mon, Nov 20, 2017 at 10:47 AM, Jody Klymak <jklymak at uvic.ca> wrote:

On 20 Nov 2017, at 10:37 AM, Neal Becker <ndbecker2 at gmail.com> wrote:

I can plot my semilogy plot fine to Qt5Agg backend, but switching to pdf
gave the error
ValueError: Can only output finite numbers in PDF

Of course I can workaround it, but it's inconsistent (and annoying).

That does sound annoying.

If you give a MSCWE, and a more complete backtrace, maybe it can be
fixed. Probably better to just make a github issue (after searching if it
already exists).

Cheers, Jody

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

--
Yuxiang "Shawn" Wang, PhD
yw5aj at virginia.edu
+1 (434) 284-0836

Neal Becker <ndbecker2 at gmail.com> writes:

I can plot my semilogy plot fine to Qt5Agg backend, but switching to pdf
gave the error
ValueError: Can only output finite numbers in PDF

This means the pdf backend has received infinite values, probably from
taking the logarithm of a nonpositive number. Somewhere in the chain
between semilogy and the pdf backend there should be logic that decides
what to do with those (e.g. clip to figure edge, or omit the point and
adjacent lines entirely).

In my copy of matplotlib 2.0.2 I don't see an error message from the
following code. Instead the negative value and adjacent lines are simply
missing.

    from matplotlib import pyplot as plt
    plt.semilogy([3,1,4,-1,5,9])
    plt.savefig('semilogy.pdf')

···

--
Jouni K. Sepp?nen
http://www.iki.fi/jks