How can i boxplot only the non-masked values of a MaskedArray ? I tought this would happen automatically by boxplot(ma) but this seems to boxplot the non-masked array.
How can i boxplot only the non-masked values of a MaskedArray ? I tought
Share
I think you are right —
plt.boxplotignores the mask if sent a masked array.So it looks like you’ll have to give
boxplotsome extra help by sending it only the values which are not masked. Since each row of the array may have a different number of unmasked values, you won’t be able to use a numpy array. You’ll have to form a Python sequence of vectors:For example:
Above, the first subplot shows a boxplot of all the data in
x(ignoring the mask), and the second subplot shows a boxplot of only those values which are not masked.