From: Norbert N. <Nor...@gm...> - 2004-11-10 11:32:57
|
Hi there, I hit a strange but in the code for logarithmic plotting. Executing the following code: ---------------------------------- from matplotlib.matlab import * plot([1.,2.],[0.01,0.2]) gca().set_yscale('log') show() ---------------------------------- gives the following traceback: ------------------------------------ Traceback (most recent call last): File "./matplotlib-bug.py", line 4, in ? show() File "/home/nobbi/NNlab/install/lib/python2.3/site-packages/matplotlib/backends/backend_tkagg.py", line 68, in show manager.show() File "/home/nobbi/NNlab/install/lib/python2.3/site-packages/matplotlib/backends/backend_tkagg.py", line 284, in show self.canvas.draw() File "/home/nobbi/NNlab/install/lib/python2.3/site-packages/matplotlib/backends/backend_tkagg.py", line 135, in draw FigureCanvasAgg.draw(self) File "/home/nobbi/NNlab/install/lib/python2.3/site-packages/matplotlib/backends/backend_agg.py", line 310, in draw self.figure.draw(self.renderer) File "/home/nobbi/NNlab/install/lib/python2.3/site-packages/matplotlib/figure.py", line 254, in draw for a in self.axes: a.draw(renderer) File "/home/nobbi/NNlab/install/lib/python2.3/site-packages/matplotlib/axes.py", line 935, in draw self.transData.freeze() # eval the lazy objects ValueError: Cannot take log of nonpositive value ------------------------------------- The appearance of this bug actually depends opn the ratio between the y-values given: if the factor exceeds 10, the code breaks: [0.1,0.2] works [0.01,0.02] works [0.1,1.0] works [0.1,2.0] breaks [1.0,11.0] breaks Also: the problem does not appear when using semilogy I'm using cvs versions of matplotlib and Numeric on python 2.3.4 Greetings, Norbert -- _________________________________________Norbert Nemec Bernhardstr. 2 ... D-93053 Regensburg Tel: 0941 - 2009638 ... Mobil: 0179 - 7475199 eMail: <No...@Ne...> |