I am trying to plot with quiver (matplotlib). My arrows indicates correlation, so I would like to change its colors according to pvalue. When I create an np.ndarray with strings ("w" or "k") that indicates the colors of each arrow, I get this error:
ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
I think that the problem is in the dtype
, because it throws me the same error if I just set the color using a string, for example "w".
I saw examples that use strings to set colors but is not working for me.