-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
680 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
function jitterExamples | ||
|
||
% | ||
% % Jitter examples | ||
% % default jitter is 0.3 | ||
% | ||
% clf | ||
% | ||
% R = randn(20,5); | ||
% | ||
% subplot(2,1,1) | ||
% notBoxPlot(R,'jitter',0.15) | ||
% | ||
% subplot(2,1,2) | ||
% notBoxPlot(R,'jitter',0.75); | ||
% | ||
|
||
help(['NBP.',mfilename]) | ||
|
||
clf | ||
|
||
R = randn(20,5); | ||
|
||
subplot(2,1,1) | ||
notBoxPlot(R,'jitter',0.15) | ||
|
||
subplot(2,1,2) | ||
notBoxPlot(R,'jitter',0.75); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
function lineExamples | ||
|
||
% % Mixing lines and areas [note that the way notBoxPlot | ||
% % sets the x axis limits can cause problems when combining plots | ||
% % this way] | ||
% | ||
% clf | ||
% | ||
% subplot(1,2,1) | ||
% h=notBoxPlot(randn(10,1)+4,5,'style','line'); | ||
% set(h.data,'color','m') | ||
% h=notBoxPlot(randn(50,10)); | ||
% set(h(5).data,'color','m') | ||
% | ||
% subplot(1,2,2) | ||
% y=randn(50,1); | ||
% clf | ||
% notBoxPlot(y,1,'style','sdline') | ||
% notBoxPlot(y,2) | ||
% xlim([0,3]) | ||
|
||
help(['NBP.',mfilename]) | ||
|
||
clf | ||
|
||
subplot(1,2,1) | ||
h=notBoxPlot(randn(10,1)+4,5,'style','line'); | ||
set(h.data,'color','m') | ||
h=notBoxPlot(randn(50,10)); | ||
set(h(5).data,'color','m') | ||
|
||
subplot(1,2,2) | ||
y=randn(50,1); | ||
notBoxPlot(y,1,'style','sdline') | ||
notBoxPlot(y,2) | ||
xlim([0,3]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
function linearModelExamples | ||
|
||
% % Linear model call format | ||
% | ||
% | ||
% % Build data | ||
% rng(555), | ||
% n=10; | ||
% R=rand(n,5); | ||
% R(:,3)=R(:,3)+1; | ||
% | ||
% X=repmat(1:5,size(R,1),1); | ||
% lemmings=R(:); | ||
% group=X(:); | ||
% | ||
% clf | ||
% | ||
% % We can call notBoxPlot with just X and Y | ||
% subplot(2,2,1) | ||
% notBoxPlot(lemmings,group,'jitter',0.75) | ||
% grid on, box on | ||
% ylim([-0.5,2.2]) | ||
% title('two vectors') | ||
% | ||
% % We can create a table and get the same plot plus the variable names on the axes | ||
% subplot(2,2,2) | ||
% T = table(lemmings,group); | ||
% notBoxPlot(T,'jitter',0.75) | ||
% grid on, box on | ||
% ylim([-0.5,2.2]) | ||
% title('table') | ||
% | ||
% % We can fit a linear model do the data and plot this | ||
% subplot(2,2,3) | ||
% group = categorical(group); | ||
% T = table(lemmings,group); | ||
% M = fitlm(T,'lemmings ~ group'); | ||
% notBoxPlot(M,'jitter',0.75) | ||
% grid on, box on | ||
% ylim([-0.5,2.2]) | ||
% title('model') | ||
% | ||
% % Increase variance of one group | ||
% subplot(2,2,4) | ||
% lemmings(end-n+1:end) = lemmings(end-n+1:end)*1.75; | ||
% T = table(lemmings,group); | ||
% M = fitlm(T,'lemmings ~ group'); | ||
% notBoxPlot(M,'jitter',0.75) | ||
% grid on, box on | ||
% ylim([-0.5,2.2]) | ||
% title('increased variance in group 5') | ||
|
||
help(['NBP.',mfilename]) | ||
|
||
|
||
|
||
|
||
% Build data | ||
rng(555), | ||
n=10; | ||
R=rand(n,5); | ||
R(:,3)=R(:,3)+1; | ||
|
||
X=repmat(1:5,size(R,1),1); | ||
lemmings=R(:); | ||
group=X(:); | ||
|
||
|
||
clf | ||
|
||
% We can call notBoxPlot with just X and Y | ||
subplot(2,2,1) | ||
notBoxPlot(lemmings,group,'jitter',0.75) | ||
grid on, box on | ||
ylim([-0.5,2.2]) | ||
title('two vectors') | ||
|
||
% We can create a table and get the same plot plus the variable names on the axes | ||
subplot(2,2,2) | ||
T = table(lemmings,group); | ||
notBoxPlot(T,'jitter',0.75) | ||
grid on, box on | ||
ylim([-0.5,2.2]) | ||
title('table') | ||
|
||
% We can fit a linear model do the data and plot this | ||
subplot(2,2,3) | ||
group = categorical(group); | ||
T = table(lemmings,group); | ||
M = fitlm(T,'lemmings ~ group'); | ||
notBoxPlot(M,'jitter',0.75) | ||
grid on, box on | ||
ylim([-0.5,2.2]) | ||
title('model') | ||
|
||
|
||
% Increase variance of one group | ||
subplot(2,2,4) | ||
lemmings(end-n+1:end) = lemmings(end-n+1:end)*1.75; | ||
T = table(lemmings,group); | ||
M = fitlm(T,'lemmings ~ group'); | ||
notBoxPlot(M,'jitter',0.75) | ||
grid on, box on | ||
ylim([-0.5,2.2]) | ||
title('increased variance in group 5') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
function simpleExamples | ||
% | ||
% clf | ||
% | ||
% subplot(2,2,1) | ||
% notBoxPlot(randn(20,5)); | ||
% | ||
% subplot(2,2,2) | ||
% notBoxPlot(randn(20,5),[1:4,7]); | ||
% | ||
% subplot(2,2,3) | ||
% h=notBoxPlot(randn(10,20)); | ||
% d=[h.data]; | ||
% set(d(1:4:end),'markerfacecolor',[0.4,1,0.4],'color',[0,0.4,0]) | ||
% | ||
% subplot(2,2,4) | ||
% x=[1,2,3,4,5,5]; | ||
% y=randn(20,length(x)); | ||
% y(:,end)=y(:,end)+3; | ||
% y(:,end-1)=y(:,end-1)-1; | ||
% notBoxPlot(y,x); | ||
|
||
help(['NBP.',mfilename]) | ||
|
||
clf | ||
|
||
subplot(2,2,1) | ||
notBoxPlot(randn(20,5)); | ||
|
||
subplot(2,2,2) | ||
notBoxPlot(randn(20,5),[1:4,7]); | ||
|
||
subplot(2,2,3) | ||
h=notBoxPlot(randn(10,20)); | ||
d=[h.data]; | ||
set(d(1:4:end),'markerfacecolor',[0.4,1,0.4],'color',[0,0.4,0]) | ||
|
||
|
||
subplot(2,2,4) | ||
x=[1,2,3,4,5,5]; | ||
y=randn(20,length(x)); | ||
y(:,end)=y(:,end)+3; | ||
y(:,end-1)=y(:,end-1)-1; | ||
notBoxPlot(y,x); |
Oops, something went wrong.