plot(), cplot(), splot() show the previous blank graph windows when exceptions have been raised until the successful run.
>>> plot(lambda t: 'a', (0, 2))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "*\Python312\Lib\site-packages\mpmath\visualization.py", line 62, in plot
if ctx.isnan(v) or abs(v) > 1e300:
^^^^^^^^^^^^
File "*\Python312\Lib\site-packages\mpmath\ctx_mp.py", line 302, in isnan
x = ctx.convert(x)
^^^^^^^^^^^^^^
File "*\Python312\Lib\site-packages\mpmath\ctx_mp_python.py", line 831, in convert
return ctx._convert_fallback(x, strings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "*\Python312\Lib\site-packages\mpmath\ctx_mp.py", line 595, in _convert_fallback
raise TypeError("cannot create mpf from " + repr(x))
TypeError: cannot create mpf from 'a'
>>> plot(lambda t: t**2, (0, 2))
>>> plot(lambda t: 'a', (0, 2))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "*\Python312\Lib\site-packages\mpmath\visualization.py", line 62, in plot
if ctx.isnan(v) or abs(v) > 1e300:
^^^^^^^^^^^^
File "*\Python312\Lib\site-packages\mpmath\ctx_mp.py", line 302, in isnan
x = ctx.convert(x)
^^^^^^^^^^^^^^
File "*\Python312\Lib\site-packages\mpmath\ctx_mp_python.py", line 831, in convert
return ctx._convert_fallback(x, strings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "*\Python312\Lib\site-packages\mpmath\ctx_mp.py", line 595, in _convert_fallback
raise TypeError("cannot create mpf from " + repr(x))
TypeError: cannot create mpf from 'a'
>>> cplot(lambda t: t, (0, 2))

plot(),cplot(),splot()show the previous blank graph windows when exceptions have been raised until the successful run.