-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
Milestone
Description
Summary
I accidentally set linewidth as '2'
instead of 2 and the resulting error message is of no help:
[/usr/local/lib/python3.11/dist-packages/matplotlib/backends/backend_agg.py](https://localhost:8080/#) in draw_path(self, gc, path, transform, rgbFace)
128 else:
129 try:
--> 130 self._renderer.draw_path(gc, path, transform, rgbFace)
131 except OverflowError:
132 cant_chunk = ''
RuntimeError: Unable to cast Python instance of type <class 'tuple'> to C++ type '?' (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)
Proposed fix
Other parameters like color get validated real time, so if it's not too expensive I think validating that linewidth is a number could save some debugging frustration.