Commit c39f0592 authored by Sam Harrison's avatar Sam Harrison
Browse files

Tidy up figure plotting code

parent 5f77760e
......@@ -36,9 +36,7 @@ plotFigures = false;
restoredefaultpath();
initialiseEnvironment();
if plotFigures
prettyFigures();
end
prettyFigures();
rng('shuffle');
......
......@@ -143,7 +143,7 @@ scores.pcA.metric = 'Cosine similarity';
scores.pcA.range = [-1.0, 1.0];
% Each element, across subjects (i.e. behavioural prediction)
scores.pcA_xs.data = diag(corr(pcAz', inf_pcAz'));
scores.pcA_xs.name = 'Netmats (cross subject corrs)';
scores.pcA_xs.name = 'Netmats (cross subject)';
scores.pcA_xs.metric = 'Correlation';
scores.pcA_xs.range = [-1.0, 1.0];
......
......@@ -15,6 +15,10 @@ else
visibility = 'off';
end
% https://github.com/altmany/export_fig/issues/75
warning('off', 'MATLAB:prnRenderer:opengl');
warning('off', 'export_fig:transparency');
%--------------------------------------------------------------------------
% Get all the metadata sorted
......@@ -43,26 +47,26 @@ for test = tests'
plotDistributions(results.methods, results.data, visibility);
ylim(results.range + 0.025 * diff(results.range) * [-1; 1]);
ylabel(results.metric);
title(results.name);
if saveFigures
set(gcf(), 'Position', figPosSquare);
set(gcf(), 'Color', 'w');
export_fig( ...
fullfile(outputDir, strrep(results.name, ' ', '_')), ...
'-pdf') % '-transparent'
'-pdf', '-painters') % '-transparent'
end
title(results.name);
% And all data
plotAllVals(results.methods, results.data, results.range, visibility);
ylabel(results.metric);
title(results.name);
if saveFigures
set(gcf(), 'Position', figPosLong);
set(gcf(), 'Color', 'w');
export_fig( ...
fullfile(outputDir, [strrep(results.name, ' ', '_') '_all']), ...
'-pdf') % '-transparent'
'-pdf', '-painters') % '-transparent'
end
title(results.name);
end
% Tidy up invisible figures that have been saved
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment