Mercurial > repos > public > sbplib
comparison spyh.m @ 423:a2cb0d4f4a02 feature/grids
Merge in default.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 07 Feb 2017 15:47:51 +0100 |
parents | 5cb99f56f55e |
children | 12db86a8ec7b |
comparison
equal
deleted
inserted
replaced
218:da058ce66876 | 423:a2cb0d4f4a02 |
---|---|
1 % spyh mimics the built in spy but returns a handle which allows modifying the plot. | |
2 function h = spyh(A) | |
3 [n,m] = size(A); | |
4 [I,J] = find(A); | |
5 | |
6 h = plot(J,I); | |
7 h.LineStyle = 'none'; | |
8 h.Marker = '.'; | |
9 h.MarkerSize = 14; | |
10 | |
11 a = gca; | |
12 xlim([0 m+1]); | |
13 ylim([0 n+1]); | |
14 axis square | |
15 a.YDir = 'reverse'; | |
16 end |