ValueError: Can only output finite numbers in PDF

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ValueError: Can only output finite numbers in PDF

Neal Becker
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).

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ValueError: Can only output finite numbers in PDF

Jody Klymak


> On 20 Nov 2017, at  10:37 AM, Neal Becker <[hidden email]> 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
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ValueError: Can only output finite numbers in PDF

Yuxiang Wang
Being curious, MSCWE stands for?

Shawn

On Mon, Nov 20, 2017 at 10:47 AM, Jody Klymak <[hidden email]> wrote:

>
>
>> On 20 Nov 2017, at  10:37 AM, Neal Becker <[hidden email]> 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
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users



--
Yuxiang "Shawn" Wang, PhD
[hidden email]
+1 (434) 284-0836
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ValueError: Can only output finite numbers in PDF

Adrien VINCENT
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 <[hidden email]> wrote:
>>
>>
>>> On 20 Nov 2017, at  10:37 AM, Neal Becker <[hidden email]> 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
>> [hidden email]
>> https://mail.python.org/mailman/listinfo/matplotlib-users
>
>
>

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ValueError: Can only output finite numbers in PDF

Yuxiang Wang
Ah got it. Thanks Adrien!

Shawn

On Mon, Nov 20, 2017 at 11:45 AM, [hidden email]
<[hidden email]> 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 <[hidden email]> wrote:
>>>
>>>
>>>
>>>> On 20 Nov 2017, at  10:37 AM, Neal Becker <[hidden email]> 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
>>> [hidden email]
>>> https://mail.python.org/mailman/listinfo/matplotlib-users
>>
>>
>>
>>
>



--
Yuxiang "Shawn" Wang, PhD
[hidden email]
+1 (434) 284-0836
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ValueError: Can only output finite numbers in PDF

Jouni K. Seppänen
In reply to this post by Neal Becker
Neal Becker <[hidden email]> 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

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users