Skip to content

Commit

Permalink
OCTV+BF+ACK: always use {X,Y}Tick when using {X,Y}TickLabel when prod…
Browse files Browse the repository at this point in the history
…ucing plots, as otherwise Octave may show a wrong label order. Thanks to #Maria Montchal# for reporting the issue
  • Loading branch information
nno committed Sep 29, 2016
1 parent 8e551d2 commit 15384af
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions doc/source/thanks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The following people have provided valuable suggestions, advice, support, or cod
+ Seth Levine
+ Stefania Mattioni
+ Mike Miller
+ Maria Montchal
+ Sam Nastase
+ Liuba Papeo
+ Nicholas Peatfield
Expand Down
5 changes: 3 additions & 2 deletions examples/demo_fmri_distatis.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@
[compromise_matrix,dim_labels,values]=cosmo_unflatten(distatis,1);

labels={'monkey', 'lemur', 'mallard', 'warbler', 'ladybug', 'lunamoth'};
n_labels=numel(labels);
figure();
imagesc(compromise_matrix)
title('DSM');
set(gca,'YTickLabel',labels);
set(gca,'XTickLabel',labels);
set(gca,'YTick',1:n_labels,'YTickLabel',labels);
set(gca,'XTick',1:n_labels,'XTickLabel',labels);
ylabel(dim_labels{1});
xlabel(dim_labels{2});
colorbar
Expand Down
5 changes: 3 additions & 2 deletions examples/demo_fmri_rois.m
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
nmasks=numel(mask_labels);

labels={'monkey', 'lemur', 'mallard', 'warbler', 'ladybug', 'lunamoth'};
nlabels=numel(labels);

% little helper function to replace underscores by spaces
underscore2space=@(x) strrep(x,'_',' ');
Expand Down Expand Up @@ -210,8 +211,8 @@
title_=sprintf('%s using %s: accuracy=%.3f', ...
underscore2space(mask_label), cfy_label, accuracy);
title(title_)
set(gca,'XTickLabel',labels);
set(gca,'YTickLabel',labels);
set(gca,'XTick',1:nlabels,'XTickLabel',labels);
set(gca,'YTick',1:nlabels,'YTickLabel',labels);
ylabel('target');
xlabel('predicted');
end
Expand Down
4 changes: 2 additions & 2 deletions examples/run_classify_lda.m
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@
figure
imagesc(confusion_matrix,[0 5])
title('confusion matrix');
set(gca,'XTickLabel',classes);
set(gca,'YTickLabel',classes);
set(gca,'XTick',1:nclasses,'XTickLabel',classes);
set(gca,'YTick',1:nclasses,'YTickLabel',classes);
ylabel('target');
xlabel('predicted');
colorbar
Expand Down
5 changes: 3 additions & 2 deletions examples/run_crossvalidation_measure.m
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@


classes = {'monkey','lemur','mallard','warbler','ladybug','lunamoth'};
set(gca,'XTickLabel',classes);
set(gca,'YTickLabel',classes);
nclasses=numel(classes);
set(gca,'XTick',1:nclasses,'XTickLabel',classes);
set(gca,'YTick',1:nclasses,'YTickLabel',classes);
ylabel('target');
xlabel('predicted');
colorbar
Expand Down
6 changes: 3 additions & 3 deletions examples/run_nfold_crossvalidate.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
% the cosmo_confusion_matrix convenience function is used to compute the
% confusion matrix
[confusion_matrix,classes]=cosmo_confusion_matrix(ds.sa.targets,all_pred);

nclasses=numel(classes);
% print confusion matrix to terminal window
fprintf('\nLDA n-fold cross-validation confusion matrix:\n')
disp(confusion_matrix);
Expand All @@ -138,8 +138,8 @@
figure
imagesc(confusion_matrix,[0 10])
title('confusion matrix');
set(gca,'XTickLabel',classes);
set(gca,'YTickLabel',classes);
set(gca,'XTick',1:nclasses,'XTickLabel',classes);
set(gca,'YTick',1:nclasses,'YTickLabel',classes);
ylabel('target');
xlabel('predicted');
colorbar
Expand Down

0 comments on commit 15384af

Please sign in to comment.