-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotDicts.m
More file actions
29 lines (25 loc) · 759 Bytes
/
Copy pathplotDicts.m
File metadata and controls
29 lines (25 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function plotDicts(Dcell, filename)
N = length(Dcell);
W = ceil(sqrt(N));
H = height(W,N);
W=2;
H=8;
fig = figure('visible', 'off');
for i=1:N
% n = size(Dcell{i},2);
% w = ceil(sqrt(n));
% [h, dif] = height(w,n);
%
% p = size(Dcell{i},1);
subaxis(W,H,i, 'SpacingVert', 0.04,'SpacingHoriz', 0, 'Padding', 0, 'MarginTop', 0.027, 'MarginBottom', 0, 'MarginRight', 0, 'MarginLeft', 0);
% d = displayPatches([Dcell{i} zeros(p,dif)]);
% imshow(d(1:h*(sqrt(p)+1) + 1, :), 'Border', 'tight');
imagesc(Dcell{i});
title(i, 'FontSize', 6);
set(gca,'xtick',[],'ytick',[]);
colormap('gray')
end
saveas(fig, filename, 'pdf')
function [h, dif] = height(w,n)
dif = w^2 - n;
h = (dif > w)*(w-1) + (dif <= w)*w;