diff spyh.m @ 361:4a5d83324ec1 feature/hypsyst

Meged with default
author Ylva Rydin <ylva.rydin@telia.com>
date Thu, 08 Dec 2016 13:38:04 +0100
parents 5cb99f56f55e
children 12db86a8ec7b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spyh.m	Thu Dec 08 13:38:04 2016 +0100
@@ -0,0 +1,16 @@
+% spyh mimics the built in spy but returns a handle which allows modifying the plot.
+function h = spyh(A)
+    [n,m] = size(A);
+    [I,J] = find(A);
+
+    h = plot(J,I);
+    h.LineStyle = 'none';
+    h.Marker = '.';
+    h.MarkerSize = 14;
+
+    a = gca;
+    xlim([0 m+1]);
+    ylim([0 n+1]);
+    axis square
+    a.YDir = 'reverse';
+end
\ No newline at end of file