image thumbnail

Binned Scatter Plot

version (3.71 KB) by Stefan Schroedl
plot quantiles of y given quantiles of x.


Updated 12 Jan 2010

View License

With the default settings, BINNED_PLOT(X,Y) splits vector X into bins of approximately equal size, and plots each median against the median of the corresponding Y-values, as well as their inter-quartile range. X and Y must have the same number of rows or columns.

This is useful to visualize two-dimensional distributions.

Options include e.g.: plotting different quantiles; means/variances instead of quantiles; varying the number of bins; and density-dependent coloring.

y=[sin(x); cos(x)] +randn(2,201);

Cite As

Stefan Schroedl (2021). Binned Scatter Plot (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: clickfit_OH for curve fitting by eye/hand

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!