Christian Kristukat wrote:
Hi,
as promised, here's the patch to add logarithmic scaling to lib/plot.py.Some words about the internal changes:
When an axis is set to be logarithmic, the class methods act on the
logarithmised data and only the method, which calculates the axis ticks is aware
of the axis type. All other methods perform their usual tasks without the
knowledge of the axis scale type. For that reason, the introduction of wrapper
methods, which handle the back conversion to the real data was necessary. The
wrapper methods inherit the names of the original ones and the latter were
rename to _methodName, which signifies that they should not be called from
outside the class. This approach has the big advantage that only few
modifications of the code were needed.
I think that the changes are still compatible with Numeric but I can't test it
Here. It would be good if someone could do that.
Traceback (most recent call last):
File "/projects/wx2.7/wxPython/wx/lib/plot.py", line 2046, in OnPlotDraw1
self.client.Draw(_draw1Objects())
File "/projects/wx2.7/wxPython/wx/lib/plot.py", line 1804, in _draw1Objects
markers1 = PolyMarker(data1, legend='Green Markers', colour='green', marker='circle',size=1)
File "/projects/wx2.7/wxPython/wx/lib/plot.py", line 283, in __init__
PolyPoints.__init__(self, points, attr)
File "/projects/wx2.7/wxPython/wx/lib/plot.py", line 124, in __init__
self._points = _Numeric.array(points).astype(float)
File "/opt/python/lib/python2.4/site-packages/numarray/numarraycore.py", line 823, in astype
type = _nt.getType(type)
File "/opt/python/lib/python2.4/site-packages/numarray/numerictypes.py", line 469, in getType
raise TypeError("Not a numeric type")
TypeError: Not a numeric type
ยทยทยท
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!