comparison spyh.m @ 691:527a7b954f26 feature/quantumTriangles

Merge with default
author Ylva Rydin <ylva.rydin@telia.com>
date Thu, 14 Sep 2017 16:00:36 +0200
parents 12db86a8ec7b
children
comparison
equal deleted inserted replaced
520:f235284e2eb1 691:527a7b954f26
1 % spyh mimics the built in spy but returns a handle which allows modifying the plot. 1 % spyh mimics the built in spy but returns a handle which allows modifying the plot.
2 function h = spyh(A) 2 function h = spyh(A)
3 [n,m] = size(A); 3 [n,m] = size(A);
4 [I,J] = find(A); 4 [I,J] = find(A);
5 5
6 h = plot(J,I); 6 if ~isempty(J)
7 h.LineStyle = 'none'; 7 h = plot(J,I);
8 h.Marker = '.'; 8 h.LineStyle = 'none';
9 h.MarkerSize = 14; 9 h.Marker = '.';
10 h.MarkerSize = 14;
11 else
12 h = [];
13 end
10 14
11 a = gca; 15 a = gca;
12 xlim([0 m+1]); 16 xlim([0 m+1]);
13 ylim([0 n+1]); 17 ylim([0 n+1]);
14 axis square 18 axis square