Javascript Count Unique Elements In Array Matlab Plot Labels Mathematica