|
1 | 1 | % 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'); |
3 | 3 | % 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 |
4 | 5 |
|
5 | 6 | % Clear things up |
6 | 7 | clear all; |
|
23 | 24 | % Preparing stuff to automate the plots |
24 | 25 | % This will allow us to automatically select a different color and shape for each curve |
25 | 26 | colorvec = 'rgbmc'; |
26 | | -markerstylevec = '+o*.xsd^v><ph'; |
| 27 | +markerstylevec = '+od*.xs^v><ph'; |
27 | 28 | linestylevec = {'-' ; ':' ; '--' ; '-.'}; |
28 | 29 | linestylestd = ':'; |
29 | 30 |
|
|
354 | 355 | plot_title2 = plot_title; % back up plot title for the theo curve |
355 | 356 | plot_title = strcat(plot_title, sprintf(' - %i it', iterations)); |
356 | 357 |
|
357 | | - % -- Efficiency 1 |
| 358 | + % -- Set style |
358 | 359 | lstyleidx = mod(counter-1, numel(linestylevec))+1; % change line style ... |
359 | 360 | mstyleidx = mod(counter-1, numel(markerstylevec))+1; % and change marker style per plot |
360 | 361 |
|
| 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 |
361 | 373 | lstyle = linestylevec(1, 1); lstyle = lstyle{1}; % for MatLab, can't do that in one command... |
362 | 374 |
|
363 | 375 | cur_plot = plot(E_interp(:,counter), EFF_interp(:,counter), sprintf('%s%s%s', lstyle, markerstylevec(mstyleidx), colorvec(coloridx))); % plot one line |
|
378 | 390 | warning(err); |
379 | 391 | end |
380 | 392 |
|
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 | | - |
390 | 393 | counter = counter + 1; |
391 | 394 | end |
392 | 395 | end |
|
398 | 401 | colornm = 'k'; |
399 | 402 | counter = 1; |
400 | 403 | for om=1:numel(overlays_max) |
| 404 | + if overlays_max(om) ~= 0 && overlays_max(om) ~= 1; continue; end; |
401 | 405 | lstyleidx = mod(counter-1, numel(linestylevec))+1; |
402 | 406 | mstyleidx = mod(counter-1, numel(markerstylevec))+1; |
403 | 407 |
|
|
425 | 429 | end |
426 | 430 |
|
427 | 431 | % 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! |
429 | 433 | 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. |
431 | 435 | % Setup axis |
432 | 436 | xlim([0 round(max(max(E)))]); % adjust x axis zoom |
433 | 437 | ylim([0 1]); |
|
0 commit comments