pgf backend doesn't work well with very large numbers #1857

Closed
elenril opened this Issue Mar 26, 2013 · 3 comments

Projects

None yet

3 participants

elenril commented Mar 26, 2013

When plotting data with very large values (in my use case I have around 10^55), the pgf backend produces files on which latex chokes saying:

! Number too big.
13653335517
866810233117889238902434402615404068235693260800.000000in
l.97 ...8902434402615404068235693260800.000000in}}
%
I can only go up to 2147483647='17777777777="7FFFFFFF,
so I'm using that number instead of yours.

From a quick look at the code, it apparrently just sets the clipping rectangle and just passes then numbers through otherwise. I suppose some clipping should happen in the backend itself.

Owner
mdboom commented Mar 26, 2013

@pwuertz : I haven't looked into this in depth, but thought I might provide a pointer: matplotlib does have algorithms to clip paths to a rectangle that may be useful here. See Path.iter_segments which has a clip kwarg.

@pwuertz pwuertz was assigned Mar 26, 2013
@pwuertz pwuertz added a commit to pwuertz/matplotlib that referenced this issue Mar 26, 2013
@pwuertz pwuertz backend_pgf: clip paths within the backend (fixes #1857) 76de282
Contributor
pwuertz commented Mar 26, 2013

Thanks for the hint mdboom!
@elenril: Does that patch fix the problem you are seeing or can you post an example that triggers the error?

elenril commented Mar 28, 2013

@pwuertz thanks for the fix, it seems to work for me.

@pwuertz pwuertz added a commit to pwuertz/matplotlib that referenced this issue Mar 31, 2013
@pwuertz pwuertz backend_pgf: clip paths within the backend (fixes #1857) 371a870
@pwuertz pwuertz closed this in 70f2296 Apr 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment