Question

I'd like to plot grouped data in a scatter plot with marginal histograms using Matlab. There is a function to do just that: scatterhist.

However, I'm dealing with some visualization issues: I have a large number of data points and many points are printed one over another (changing marker type and marker size doesn't help).

Therefore, I'd prefer to substitute individual points from each group with their convex hull; i.e., if I have 5 groups, the plot would show 5 convex hulls and keep marginal histograms generated from the original data points. Do you know if there is an easy way to do this or if this has already been implemented?

Was it helpful?

Solution

In the end, I came up with the following:

  1. Use scatterhist to create the scatter plot with marginal histograms.
  2. hold on
  3. Use convhull to get the convex hull for each group of points.
  4. Use fill to draw the convex hull.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top