Consider a function that outputs a nested vector such as
[[[-0.6925523827697917 -0.4095089425269985]
[-0.03856010899727634 0.8427233420960013]
[-2.609986195686694E-13 -1.680032093051418E-12]]
[[0.7203362514229046 -0.3494564274369062]]]
In between single brackets, i.e. [-0.6925523827697917 -0.4095089425269985]
, are numbers to be plotted in Cartesian coordinates.
Additionally there are vectors within another bracket, i.e.
[[0.7203362514229046 -0.3494564274369062]]
which denotes a cluster.
I am seeking to plot the points, which are the vectors above, and draw a line connecting points within a cluster. So, the points within the cluster [[-0.6925523827697917 -0.4095089425269985] [-0.03856010899727634 0.8427233420960013] [-2.609986195686694E-13 -1.680032093051418E-12]]
would be connected.
My first thought would be to use Incanter's xy-plot. The part I am unsure is how to go from an indexed structure such as the vector to a point on the plot. Additionally, I am not sure how to draw a line connecting the clustered points. The example above should have one line (preferably smooth) through the three points in the first cluster, and no line through the last cluster since there is just one point within the cluster.