-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
The following call in xarray/xarray/plot/plot.py does not seem to be thread safe:
cbar = plt.colorbar(primitive, **cbar_kwargs)
It leads to systematic crashes when distributed, with a cryptic error message (ValueError: Unknown element o). I have to call colorbars outside the xarray plot call to prevent crashes.
A call of the following type may fix the problem:
cbar = fig.colorbar(primitive, **cbar_kwargs)
But fig does not seem to be available directly in plot.py. Maybe:
cbar = ax.get_figure().colorbar(primitive, **cbar_kwargs)
cheers