File Exchange

image thumbnail

ebpatch(x, y, er, col, alp)

version (617 Bytes) by

Making patch plot with simple interface

1 Download


View License

Making patch plot with simple interface
Inspired by
boundedline.m (

x = rand(512*2,1);
y = 4*x + randn(size(x));
y2 = 1*x + randn(size(x));

[yv, ev, ~] = xbinavg(x, y, 0:.05:1, 0);
[yv2, ev2, xv] = xbinavg(x, y2, 0:.05:1, 0);
scatter(x,y, '.r', 'MarkerFaceAlpha', .2, 'MarkerEdgeAlpha', .5); hold on;
scatter(x,y2, '.b', 'MarkerFaceAlpha', .2, 'MarkerEdgeAlpha', .5);

clear ph lh
[ph(1), lh(1)] = ebpatch(xv, yv, ev, 'r');
[ph(2), lh(2)] = ebpatch(xv, yv2, ev2, 'b');

% - modify design
set(lh, 'LineWidth', 2)
set(ph, 'FaceAlpha', .2)

using xbinavg.m (

Comments and Ratings (1)


Haibo (view profile)

Hi Ryosuke, thanks! it solves my question the boundedline could not do.

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

Inspired by: boundedline.m

MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video