Skip to content

Commit 81c14b1

Browse files
committed
edit: better plot fig3tags1ehsan_eff.m
Signed-off-by: Stephen L. <[email protected]>
1 parent d3ad0ca commit 81c14b1

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

figures/fig3tags1ehsan_eff.m

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
% Overlays network: Behrooz vs overlays benchmark. Please use Octave >= 3.8.1 for reasonable performances!
2-
% To print a figure: print(1, 'test.eps', '-color');
2+
% To print a figure: print(2, 'test2.eps', '-color', '-S400,300', '-rNUM 300');
33
% On Windows, use IrfanView and GhostScript 32-bits to read .eps files without quality loss (all the others will show a deformed image).
4+
% Gnuplot commands: http://stackoverflow.com/questions/3207148/zoom-out-in-octave-gnuplot?rq=1
45

56
% Clear things up
67
clear all;
@@ -23,7 +24,7 @@
2324
% Preparing stuff to automate the plots
2425
% This will allow us to automatically select a different color and shape for each curve
2526
colorvec = 'rgbmc';
26-
markerstylevec = '+o*.xsd^v><ph';
27+
markerstylevec = '+od*.xs^v><ph';
2728
linestylevec = {'-' ; ':' ; '--' ; '-.'};
2829
linestylestd = ':';
2930

@@ -354,10 +355,21 @@
354355
plot_title2 = plot_title; % back up plot title for the theo curve
355356
plot_title = strcat(plot_title, sprintf(' - %i it', iterations));
356357

357-
% -- Efficiency 1
358+
% -- Set style
358359
lstyleidx = mod(counter-1, numel(linestylevec))+1; % change line style ...
359360
mstyleidx = mod(counter-1, numel(markerstylevec))+1; % and change marker style per plot
360361

362+
% -- Theoretical efficiency
363+
if overlays_max(om) == 0 || overlays_max(om) == 1 % theo error rate is for the moment wrong for any other tags number than 0 or 1
364+
lstyle = linestylevec(3, 1); lstyle = lstyle{1}; % for MatLab, can't do that in one command...
365+
cur_plot = plot(TE_interp(:,counter), EFF_interp(:,counter), sprintf('%s%s%s', lstyle, markerstylevec(mstyleidx), colorvec(coloridx))); % plot one line
366+
set(cur_plot, plot_curves_params{:}); % additional plot style
367+
plot_title2 = strcat(plot_title2, ' - theo');
368+
369+
set(cur_plot, 'DisplayName', plot_title2); % add the legend per plot, this is the best method, which also works with scatterplots and polar plots, see http://hattb.wordpress.com/2010/02/10/appending-legends-and-plots-in-matlab/
370+
end
371+
372+
% -- Efficiency / error rate ratio
361373
lstyle = linestylevec(1, 1); lstyle = lstyle{1}; % for MatLab, can't do that in one command...
362374

363375
cur_plot = plot(E_interp(:,counter), EFF_interp(:,counter), sprintf('%s%s%s', lstyle, markerstylevec(mstyleidx), colorvec(coloridx))); % plot one line
@@ -378,15 +390,6 @@
378390
warning(err);
379391
end
380392

381-
% -- Theoretical efficiency
382-
lstyle = linestylevec(3, 1); lstyle = lstyle{1}; % for MatLab, can't do that in one command...
383-
cur_plot = plot(TE_interp(:,counter), EFF_interp(:,counter), sprintf('%s%s%s', lstyle, markerstylevec(mstyleidx), colorvec(coloridx))); % plot one line
384-
set(cur_plot, plot_curves_params{:}); % additional plot style
385-
plot_title2 = strcat(plot_title2, ' - theo');
386-
387-
set(cur_plot, 'DisplayName', plot_title2); % add the legend per plot, this is the best method, which also works with scatterplots and polar plots, see http://hattb.wordpress.com/2010/02/10/appending-legends-and-plots-in-matlab/
388-
389-
390393
counter = counter + 1;
391394
end
392395
end
@@ -398,6 +401,7 @@
398401
colornm = 'k';
399402
counter = 1;
400403
for om=1:numel(overlays_max)
404+
if overlays_max(om) ~= 0 && overlays_max(om) ~= 1; continue; end;
401405
lstyleidx = mod(counter-1, numel(linestylevec))+1;
402406
mstyleidx = mod(counter-1, numel(markerstylevec))+1;
403407

@@ -425,9 +429,9 @@
425429
end
426430

427431
% Refresh plot with legends
428-
legend(get(gca,'children'),get(get(gca,'children'),'DisplayName'), 'location', 'southeast'); % IMPORTANT: force refreshing to show the legend, else it won't show!
432+
legend(get(gca,'children'),get(get(gca,'children'),'DisplayName'), 'location', 'northwest'); % IMPORTANT: force refreshing to show the legend, else it won't show!
429433
legend('boxoff');
430-
legend('left'); % Bug workaround: as of Octave 3.8.1, gnuplot produce weird legend text, with a huge blank space because it horizontally align legend text to the right, and there's no way currently to change to left. Only solution is to move the text to the left and symbols to the right, this way there's no blank space anymore.
434+
%legend('left'); % Bug workaround: as of Octave 3.8.1, gnuplot produce weird legend text, with a huge blank space because it horizontally align legend text to the right, and there's no way currently to change to left. Only solution is to move the text to the left and symbols to the right, this way there's no blank space anymore.
431435
% Setup axis
432436
xlim([0 round(max(max(E)))]); % adjust x axis zoom
433437
ylim([0 1]);

0 commit comments

Comments
 (0)