SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Philippe S. <phi...@pr...> - 2004年04月29日 10:09:25
The same case as explained in my previous email, but supplying all values 
converted to floats:
 File "/usr/lib/python2.2/site-packages/matplotlib/ticker.py", line 202, in 
pprint_val
 if abs(x-int(x))<0.0001*d: return '%d' % int(x + 0.5)
OverflowError: float too large to convert
From: John H. <jdh...@ac...> - 2004年04月29日 15:08:08
>>>>> "Philippe" == Philippe Strauss <phi...@pr...> writes:
 Philippe> The same case as explained in my previous email, but
 Philippe> supplying all values converted to floats:
Responding to both points at once...
The log10 issue you experienced appears to be a ufunc problem. I'm
using the Numeric log10 but in this module don't need it since I'm not
opertating over arrays. Replacing all instances og log10 with
math.log10 in the matplotlib.ticker module.
 Philippe> File
 Philippe> "/usr/lib/python2.2/site-packages/matplotlib/ticker.py",
 Philippe> line 202, in pprint_val if abs(x-int(x))<0.0001*d:
 Philippe> return '%d' % int(x + 0.5) OverflowError: float too
 Philippe> large to convert
You should be able to replace the ints with longs here with no
troubles. Likewise in the LogFormatter class on or around line 234
you should do the same.
I wrote this little example to add to our poor man's unit testing
suite
 from matplotlib.matlab import *
 x = arange(1000) + 2**32
 subplot(211)
 plot(x,x)
 subplot(212)
 loglog(x,x)
 show()
With the changes above, it plots but the log ticker apparently fails
to handle this case so I'll look into that. I think it is because
there are no decades in the plot range.
If you can think of a more suitable test case for plotting large
numbers, please pass it on and I'll include it.
Thanks,
John Hunter
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /