matplotlib: fehler mit loglog
Verfasst: Montag 16. April 2007, 17:47
hallo. wenn ich in folgendem code
den befehl plot durch loglog ersetze, um eine doppelt logarithmische achseneinteilung zu erhalten, liefert mir python unzählige fehlermeldungen und kann die funktion nicht darstellen.
lässt sich da was machen?
wenn es jemandem was sagt, ich erhalten sowas wie folgendes:
e 194, in motion_notify_event
FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event)
File "C:\Python25\lib\site-packages\matplotlib\backend_bases.py", line 937, in
motion_notify_event
func(event)
File "C:\Python25\lib\site-packages\matplotlib\backend_bases.py", line 1247, i
n mouse_move
try: s = event.inaxes.format_coord(event.xdata, event.ydata)
File "C:\Python25\lib\site-packages\matplotlib\axes.py", line 1610, in format_
coord
xs = self.format_xdata(x)
File "C:\Python25\lib\site-packages\matplotlib\axes.py", line 1592, in format_
xdata
val = func(x)
File "C:\Python25\lib\site-packages\matplotlib\ticker.py", line 157, in format
_data_short
return self.format_data(value)
File "C:\Python25\lib\site-packages\matplotlib\ticker.py", line 456, in format
_data
value = strip_math(self.__call__(value))
File "C:\Python25\lib\site-packages\matplotlib\ticker.py", line 526, in __call
__
fx = math.log(x)/math.log(b)
TypeError: a float is required
Code: Alles auswählen
from pylab import *
from numpy import *
x=linspace(0,10,10,endpoint=True)
figure(0)
axis([10**-12, 1, 0, 1])
subplot(111, autoscale_on=False)
plot(x,x**2)
show()
lässt sich da was machen?
wenn es jemandem was sagt, ich erhalten sowas wie folgendes:
e 194, in motion_notify_event
FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event)
File "C:\Python25\lib\site-packages\matplotlib\backend_bases.py", line 937, in
motion_notify_event
func(event)
File "C:\Python25\lib\site-packages\matplotlib\backend_bases.py", line 1247, i
n mouse_move
try: s = event.inaxes.format_coord(event.xdata, event.ydata)
File "C:\Python25\lib\site-packages\matplotlib\axes.py", line 1610, in format_
coord
xs = self.format_xdata(x)
File "C:\Python25\lib\site-packages\matplotlib\axes.py", line 1592, in format_
xdata
val = func(x)
File "C:\Python25\lib\site-packages\matplotlib\ticker.py", line 157, in format
_data_short
return self.format_data(value)
File "C:\Python25\lib\site-packages\matplotlib\ticker.py", line 456, in format
_data
value = strip_math(self.__call__(value))
File "C:\Python25\lib\site-packages\matplotlib\ticker.py", line 526, in __call
__
fx = math.log(x)/math.log(b)
TypeError: a float is required