Traceback (most recent call last):
...
File "plot_relations.py", line 507, in plot_relation
cbar = plt.colorbar(colormap)
File "python3.9/site-packages/matplotlib/pyplot.py", line 2356, in colorbar
ret = gcf().colorbar(mappable, cax=cax, ax=ax, **kw)
File "python3.9/site-packages/matplotlib/figure.py", line 1176, in colorbar
cb = cbar.Colorbar(cax, mappable, **cb_kw)
File "python3.9/site-packages/matplotlib/colorbar.py", line 1172, in __init__
mappable.autoscale_None()
File "python3.9/site-packages/matplotlib/cm.py", line 476, in autoscale_None
self.norm.autoscale_None(self._A)
File "python3.9/site-packages/matplotlib/colors.py", line 1543, in autoscale_None
super().autoscale_None(np.ma.array(A, mask=(A <= 0)))
TypeError: '<=' not supported between instances of 'list' and 'int'
(full file path hidden)
The following simplification of the code solves the issue:
in
matplotlib 3.4.3
the followingdoes not work anymore, producing
(full file path hidden)
The following simplification of the code solves the issue:
(where
normfunc
is eithermplcolors.Normalize
ormplcolors.LogNorm
depending on the case), i.e., it seemsset_array([])
is no longer needed.