O'Reilly logo

MATLAB Graphics and Data Visualization Cookbook by Swapnonil Banerjee, Nivedita Majumdar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Scatter plot smoothing

When the data volumes are huge, there may be significant over-plotting in a simple scatter plot view. In that case, one may need to look at a higher abstraction of the data than all the data points at once. To this end, there exist techniques such as density plots and scatter plot smoothing, which are shown in this recipe.

Getting ready

In this recipe, you will look at a dataset with 3000 points that shows significant over-plotting in the scatter plot view. Generate this as follows:

z = [repmat([1 2],1000,1) + randn(1000,2)*[1 .5; 0 1.32];...
  repmat([9 1],1000,1) + randn(1000,2)*[1.4 .2; 0 0.98];...
  repmat([4 8],1000,1) + randn(1000,2)*[1 .7; 0  0.71];];

How to do it…

Perform the following steps:

  1. Plot the original raw data and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required