Skip to content

call to colorbar not thread safe #1889

Closed
@apatlpo

Description

@apatlpo

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions