Hi,
I am not expert in matplotlib, I use it to generate plots
for a management performance tool.
I have just upgraded this application from 0.98.3 to 0.98.5 and
the upgrade broke the application in 3 places:
1). In units.py, Registry.get_converter(): this
method has been made recursive in 0.98.5. The problem is that if x is a
string then you get a recursion error.
The cause is the ‘iterable() function called in the
line “if converter is None and interable(x):” The interable() function
is in cbook.py and it actually tests to see if the object ‘x’ has a
len() method. Call iterable() on a string and it returns true.
Do “ for thisx in x:” and you will always get
the first character in the string, which is… a string!
My solution was to change iterable():
Def iterable(obj):
“””
Return true if obj is
iterable
“””
try: obj.iter()
except AtributeError: return
False
return True
this seems to have solved the problem.
2). Backend_svg.py._get_style(): in 0.98.3,
stroke_width is a string and in 0.98.5 it is a float. I set the styles by
reading attributes in an xml file and so the strings worked. When I upgraded, I
got ‘float’ type errors. My opinion is that we might expect
parametric polymorphism here. A stroke width could be ‘1’, 1 or 1.0
all of which are legitimate parameters. Hence, when we set the kwarg ‘lw’
on ‘plot’, a string, int or float should be legal. Just my opinion.
3). Font_manager.createFontDict() in 0.98.3 become createFontList()
in 0.98.5. I didn’t find this change in Changes, but maybe I’m
blind. What I am saying here is that if I upgrade to 0.98.5 from 0.98.3, I
would expect 0.98.5 to be less ‘broke’ than 0.98.3, not different.
I hope this is somehow helpful.
Best regards, Richard Jennings