Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Jesse Heckman
pbtoolbox
Commits
46f4451e
Commit
46f4451e
authored
Mar 01, 2019
by
Jesse Heckman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
major update PB_DRAFT, also: moving sound vPrime
parent
f5911223
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
236 additions
and
220 deletions
+236
-220
setups/vestibular chair/vPrime/tdt/rcx/Indiv Speaker test.rcx
...ps/vestibular chair/vPrime/tdt/rcx/Indiv Speaker test.rcx
+0
-0
setups/vestibular chair/vPrime/tdt/rcx/StateMachineV1.11.rcx
setups/vestibular chair/vPrime/tdt/rcx/StateMachineV1.11.rcx
+0
-0
setups/vestibular chair/vPrime/tdt/rcx/StateMachineV1.16 correctietest.rcx
... chair/vPrime/tdt/rcx/StateMachineV1.16 correctietest.rcx
+0
-0
subtools/draft/@pb_draft/draft.m
subtools/draft/@pb_draft/draft.m
+29
-33
subtools/draft/@pb_draft/draft2.m
subtools/draft/@pb_draft/draft2.m
+0
-103
subtools/draft/@pb_draft/pb_draft.m
subtools/draft/@pb_draft/pb_draft.m
+5
-5
subtools/draft/@pb_draft/plot_rawdata.m
subtools/draft/@pb_draft/plot_rawdata.m
+0
-2
subtools/draft/@pb_draft/private/make_axes.m
subtools/draft/@pb_draft/private/make_axes.m
+13
-9
subtools/draft/@pb_draft/private/parse_va.m
subtools/draft/@pb_draft/private/parse_va.m
+32
-18
subtools/draft/@pb_draft/stat_probit.m
subtools/draft/@pb_draft/stat_probit.m
+89
-0
subtools/draft/example_draft.m
subtools/draft/example_draft.m
+61
-30
utilities/statistics/pb_probit.m
utilities/statistics/pb_probit.m
+4
-18
utilities/statistics/pb_regplot.m
utilities/statistics/pb_regplot.m
+3
-2
No files found.
setups/vestibular chair/vPrime/tdt/rcx/Indiv Speaker test.rcx
0 → 100644
View file @
46f4451e
File added
setups/vestibular chair/vPrime/tdt/rcx/StateMachineV1.11.rcx
deleted
100644 → 0
View file @
f5911223
File deleted
setups/vestibular chair/vPrime/tdt/rcx/StateMachineV1.1
2
.rcx
→
setups/vestibular chair/vPrime/tdt/rcx/StateMachineV1.1
6 correctietest
.rcx
View file @
46f4451e
No preview for this file type
subtools/draft/@pb_draft/draft.m
View file @
46f4451e
...
...
@@ -7,7 +7,8 @@ function draft(obj)
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
%% Create figure
%% Initialize Draft
% Make figure, select parents, and set layouts
% Select parent/make figure
if
isempty
(
obj
(
1
)
.
parent
)
...
...
@@ -19,47 +20,47 @@ function draft(obj)
% Set figure settings
set
(
obj
(
1
)
.
parent
,
'color'
,
'w'
);
t
=
sgtitle
(
obj
(
1
)
.
parent
,
obj
(
1
)
.
title
);
set
(
t
,
'FontSize'
,
20
);
set
(
t
,
'FontSize'
,
18
);
ax
=
gobjects
(
0
);
objsz
=
size
(
obj
);
%% Super labels
% Check
if labels are the same,
and prep super
labels
% Check and prep
are
superlabels
lab_x
=
true
;
lab_y
=
true
;
% Check labels
bool
=
true
;
if
numel
(
obj
)
==
1
;
bool
=
false
;
end
lab_x
=
bool
;
lab_y
=
bool
;
for
iObj
=
1
:
numel
(
obj
)
if
~
strcmp
(
obj
(
1
)
.
labels
.
xlab
,
obj
(
iObj
)
.
labels
.
xlab
);
lab_x
=
false
;
end
if
~
strcmp
(
obj
(
1
)
.
labels
.
ylab
,
obj
(
iObj
)
.
labels
.
ylab
);
lab_y
=
false
;
end
end
% Set superlabels
obj
(
1
)
.
labels
.
supx
=
lab_x
;
obj
(
1
)
.
labels
.
supy
=
lab_y
;
%% Set Compare axis
cmp
=
length
(
unique
(
obj
(
1
)
.
pva
.
axcomp
.
feature
));
cmpsz
=
[
1
1
];
nObj
=
numel
(
obj
)
*
cmp
;
%% Set Compare Axis
% Check and set comparing axis
if
min
(
objsz
)
>
1
cmp
=
1
;
else
if
objsz
(
1
)
<
objsz
(
2
)
% horizontal direction
cmpsz
(
1
)
=
cmp
;
else
% vertical direction
cmpsz
(
2
)
=
cmp
;
end
end
nCmp
=
length
(
unique
(
obj
(
1
)
.
pva
.
axcomp
.
feature
));
if
min
(
objsz
)
>
1
;
nCmp
=
1
;
end
%% Create (sub)plots
cmpsz
=
[
1
1
];
nObj
=
numel
(
obj
)
*
nCmp
;
[
~
,
cmpInd
]
=
max
(
cmpsz
);
cmpsz
(
cmpInd
)
=
nCmp
;
cmpsz
=
fliplr
(
cmpsz
);
%% Create Plots
% Draft each subplot
for
iObj
=
1
:
numel
(
obj
)
% Repeat for comparing axis
for
iCmp
=
1
:
c
mp
cObj
=
(
iObj
-
1
)
*
c
mp
+
iCmp
;
for
iCmp
=
1
:
nC
mp
cObj
=
(
iObj
-
1
)
*
nC
mp
+
iCmp
;
% Make Axes
Ax
=
pb_invidx
([
objsz
(
1
)
*
cmpsz
(
1
),
objsz
(
2
)
*
cmpsz
(
2
)],
cObj
);
% reverse get axes index
...
...
@@ -70,19 +71,15 @@ function draft(obj)
axis
(
obj
(
Ax2Obj
)
.
pva
.
axis
);
hold
on
;
% Select data
uFeat
=
unique
(
obj
(
1
)
.
pva
.
axcomp
.
feature
);
sel
=
obj
(
1
)
.
pva
.
axcomp
.
feature
==
uFeat
(
iCmp
);
% Select data
features
=
unique
(
obj
(
1
)
.
pva
.
axcomp
.
feature
);
sel
=
obj
(
1
)
.
pva
.
axcomp
.
feature
==
features
(
iCmp
);
D
=
obj
(
Ax2Obj
)
.
pva
;
D
.
x
=
D
.
x
(
sel
);
D
.
y
=
D
.
y
(
sel
);
D
.
color
=
D
.
color
(
sel
);
% Set colors
nCol
=
1
;
if
~
obj
(
iObj
)
.
pva
.
continious
nCol
=
length
(
unique
(
obj
(
iObj
)
.
pva
.
color
));
end
% Plot all graphs
for
iDP
=
1
:
length
(
obj
(
iObj
)
.
dplot
)
...
...
@@ -99,12 +96,11 @@ function draft(obj)
end
end
%% Adjust
a
xis
h
andles
%% Adjust
A
xis
H
andles
% Set super labels
% TO DO:
% 1. Optionalize subplots to have squared/linked/fixed axis
% 2. Scale and move axis to make graph nice, pleasing and non-overlapping
% 1. Scale and move axis to make graph nice, pleasing and non-overlapping
obj
.
make_axes
(
ax
);
obj
.
make_suplabel
;
end
...
...
subtools/draft/@pb_draft/draft2.m
deleted
100644 → 0
View file @
f5911223
function
draft
(
obj
)
% PB_DRAFT>DRAFT
%
% OBJ.DRAFT will draw a figure from a pb_draft-object.
%
% See also PB_DRAFT, SET_LABELS, SET_TITLE, SET_GRID, PRINT
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
%% Create figure
% Select parent/make figure
if
isempty
(
obj
(
1
)
.
parent
)
for
iObj
=
1
:
numel
(
obj
)
obj
(
iObj
)
.
parent
=
gcf
;
end
end
% Set figure settings
set
(
obj
(
1
)
.
parent
,
'color'
,
'w'
);
t
=
sgtitle
(
obj
(
1
)
.
parent
,
obj
(
1
)
.
title
);
set
(
t
,
'FontSize'
,
20
);
ax
=
gobjects
(
0
);
dsz
=
size
(
obj
);
%% Super labels
% Check if labels are the same, and prep super labels
lab_x
=
true
;
lab_y
=
true
;
for
iObj
=
1
:
numel
(
obj
)
if
~
strcmp
(
obj
(
1
)
.
labels
.
xlab
,
obj
(
iObj
)
.
labels
.
xlab
);
lab_x
=
false
;
end
if
~
strcmp
(
obj
(
1
)
.
labels
.
ylab
,
obj
(
iObj
)
.
labels
.
ylab
);
lab_y
=
false
;
end
end
obj
(
1
)
.
labels
.
supx
=
lab_x
;
obj
(
1
)
.
labels
.
supy
=
lab_y
;
%% Create (sub)plots
% Draft each subplot
% Create comparing axis
cmp
=
length
(
unique
(
obj
(
1
)
.
pva
.
axcomp
.
feature
));
if
min
(
dsz
)
>
1
cmp
=
1
;
if
dsz
(
1
)
>
dsz
(
2
)
obj
(
1
)
.
pva
.
axcomp
.
orientation
=
'vertical'
;
else
obj
(
1
)
.
pva
.
axcomp
.
orientation
=
'horizontal'
;
end
end
nObj
=
numel
(
obj
)
*
cmp
;
for
iObj
=
1
:
numel
(
obj
)
% Repeat for comparing axis
for
iCmp
=
1
:
cmp
% Make Axes
iAx
=
pb_invidx
([
dsz
(
1
),
dsz
(
2
)],
iObj
);
ax
(
iAx
)
=
subplot
(
dsz
(
1
),
dsz
(
2
),
iObj
);
if
obj
(
iAx
)
.
pva
.
subtitle
;
title
(
obj
(
iAx
)
.
pva
.
subtitle
);
end
axis
(
obj
(
iAx
)
.
pva
.
axis
);
hold
on
;
% Set colors
nCol
=
1
;
if
~
obj
(
iObj
)
.
pva
.
continious
nCol
=
length
(
unique
(
obj
(
iObj
)
.
pva
.
color
));
end
% Plot all graphs
for
iDP
=
1
:
length
(
obj
(
iObj
)
.
dplot
)
d
=
obj
(
iAx
)
.
pva
;
obj
(
iObj
)
.
dplot
{
iDP
}(
obj
,
d
);
end
% Set labels
if
~
obj
(
1
)
.
labels
.
supx
;
xlabel
(
obj
(
iAx
)
.
labels
.
xlab
);
end
if
~
obj
(
1
)
.
labels
.
supy
;
ylabel
(
obj
(
iAx
)
.
labels
.
ylab
);
end
% Make scientific notations on the axes.
ax
(
iAx
)
.
YAxis
.
Exponent
=
length
(
num2str
(
max
(
abs
(
round
(
ax
(
iAx
)
.
YLim
)))))
-
1
;
ax
(
iAx
)
.
XAxis
.
Exponent
=
length
(
num2str
(
max
(
abs
(
round
(
ax
(
iAx
)
.
XLim
)))))
-
1
;
end
end
%% Adjust axis handles
% Set super labels
% TO DO:
% 1. Optionalize subplots to have squared/linked/fixed axis
% 2. Scale and move axis to make graph nice, pleasing and non-overlapping
make_axes
(
obj
,
ax
);
make_suplabel
(
obj
);
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2019) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
\ No newline at end of file
subtools/draft/@pb_draft/pb_draft.m
View file @
46f4451e
...
...
@@ -50,21 +50,21 @@ classdef pb_draft < matlab.mixin.Copyable
% Set functions
set_title
(
obj
,
title
,
varargin
);
% set title
set_legend
(
obj
,
varargin
);
% set legend
/// NOT YET DONE
set_legend
(
obj
,
varargin
);
% set legend
set_labels
(
obj
,
varargin
);
% set labels
set_grid
(
obj
,
varargin
);
% set grid
set_axcomp
(
obj
,
feature
,
varargin
);
% set comparision axe
/// WORKING ON IT
set_axcomp
(
obj
,
feature
,
varargin
);
% set comparision axe
% Plot functions
plot_rawdata
(
obj
,
varargin
);
% plot the rawdata
plot_bubble
(
obj
,
varargin
);
% plot bubble histoplot
plot_hline
(
obj
,
varargin
);
% plot horizontal lines
plot_vline
(
obj
,
varargin
);
% plot vertical lines
plot_dline
(
obj
,
varargin
);
% plot diagonal lines
plot_bubble
(
obj
,
varargin
);
% plot bubble histoplot
plot_dline
(
obj
,
varargin
);
% plot diagonal lines
% Statistical functions
stat_regres
(
obj
,
varargin
);
% transform regression // NOT YET DONE
stat_probit
(
obj
,
varargin
);
% transform probit
stat_probit
(
obj
,
varargin
);
% transform probit
// MADE NOT FINISHED
% Fitting functions
fit_ellipse
(
obj
,
varargin
);
% make ellipse fit
...
...
subtools/draft/@pb_draft/plot_rawdata.m
View file @
46f4451e
...
...
@@ -27,8 +27,6 @@ end
function
h
=
rawdata
(
~
,
data
,
p
,
colorindex
)
% Plots rawdata
%% MAKE SELECTION FOR COLOR!
sel
=
data
.
color
==
colorindex
;
x
=
data
.
x
(
sel
);
y
=
data
.
y
(
sel
);
...
...
subtools/draft/@pb_draft/private/make_axes.m
View file @
46f4451e
...
...
@@ -8,19 +8,20 @@ function make_axes(obj,ax,varargin)
% PBToolbox (2019): JJH: j.heckman@donders.ru.nl
linkaxes
(
ax
,
'xy'
);
positions
=
zeros
(
length
(
ax
),
4
);
for
iAx
=
1
:
length
(
ax
)
axis
(
ax
(
iAx
));
xt
=
xticks
;
yt
=
yticks
;
% Set Limits
if
obj
(
1
)
.
pva
.
setAxes
xlim
(
obj
(
1
)
.
pva
.
limits
.
x
);
ylim
(
obj
(
1
)
.
pva
.
limits
.
y
);
end
% Set Grids
setAx
=
ax
(
iAx
);
xlim
(
ax
(
iAx
),[
xt
(
1
)
xt
(
end
)]);
ylim
(
ax
(
iAx
),[
yt
(
1
)
yt
(
end
)]);
positions
(
iAx
,:)
=
ax
(
iAx
)
.
Position
(:);
if
obj
(
1
)
.
grid
.
bool
f
=
obj
(
1
)
.
grid
.
features
;
setAx
.
Box
=
f
.
Box
;
...
...
@@ -36,12 +37,15 @@ function make_axes(obj,ax,varargin)
setAx
.
YDir
=
f
.
YDir
;
setAx
.
LineWidth
=
f
.
LineWidth
;
end
positions
(
iAx
,:)
=
ax
(
iAx
)
.
Position
(:);
end
% Set Label Positions
% TODO: THIS MUST BE DONE WAY BETTER!!
obj
(
1
)
.
labels
.
ypos
=
min
(
positions
(:,
2
));
obj
(
1
)
.
labels
.
xpos
=
min
(
positions
(:,
1
));
obj
(
1
)
.
labels
.
pos
=
[
min
(
positions
(:,
1
))/
1.33
min
(
positions
(:,
2
))/
1.33
max
(
positions
(:,
1
)
+
positions
(:,
3
))
max
(
positions
(:,
2
)
+
positions
(:,
4
))];
obj
(
1
)
.
h_ax_plot
=
ax
;
obj
(
1
)
.
h_ax_plot
=
ax
;
end
...
...
subtools/draft/@pb_draft/private/parse_va.m
View file @
46f4451e
...
...
@@ -7,29 +7,38 @@ function parse_va(obj,varargin)
% See also PB_DRAFT
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
%% READ DATA
% Read Data, and set keyvals
%% Initialize
% Read keyvals
v
=
varargin
;
pva
.
x
=
pb_keyval
(
'x'
,
v
,[]);
pva
.
y
=
pb_keyval
(
'y'
,
v
,[]);
pva
.
z
=
pb_keyval
(
'z'
,
v
,[]);
pva
.
def
=
pb_keyval
(
'def'
,
v
,
1
);
pva
.
color
=
pb_keyval
(
'color'
,
v
,
ones
(
length
(
pva
.
x
),
1
));
pva
.
color
=
pb_keyval
(
'color'
,
v
,
ones
(
length
(
pva
.
y
),
1
));
pva
.
axis
=
pb_keyval
(
'axis'
,
v
);
pva
.
subtitle
=
pb_keyval
(
'subtitle'
,
v
);
pva
.
linkax
=
pb_keyval
(
'link'
,
v
,
true
);
pva
.
setAxes
=
pb_keyval
(
'setaxes'
,
v
,
true
);
%% Set Core
% Read, check and set data.
% Check data limits
[
x
,
y
]
=
setlim
(
pva
);
if
isempty
(
pva
.
x
);
s
=
size
(
pva
.
y
);
pva
.
x
=
zeros
(
s
(
1
),
s
(
2
));
end
[
x
,
y
]
=
setlim
(
pva
);
if
strcmp
(
pva
.
axis
,
'square'
)
&&
x
~=
y
x
=
[
min
([
x
y
])
max
([
x
y
])];
y
=
x
;
end
pva
.
limits
.
x
=
x
;
pva
.
limits
.
y
=
y
;
% Check square axis
if
isempty
(
pva
.
axis
)
if
abs
(
max
(
x
)
-
max
(
y
))
/
max
([
x
,
y
])
<
.
5
if
abs
(
max
(
x
)
-
max
(
y
))
/
max
([
x
,
y
])
<
0
.5
pva
.
axis
=
'square'
;
end
end
...
...
@@ -38,28 +47,33 @@ function parse_va(obj,varargin)
pva
.
colscheme
=
pb_selectcolor
(
length
(
unique
(
pva
.
color
)),
pva
.
def
);
pva
.
axcomp
=
axcmp
(
pva
.
x
);
% Set Labels
obj
.
labels
.
xlab
=
pb_keyval
(
'xlab'
,
v
,
''
);
obj
.
labels
.
ylab
=
pb_keyval
(
'ylab'
,
v
,
''
);
obj
.
grid
.
bool
=
false
;
% Check data continuity for colouring
pva
.
continious
=
false
;
if
length
(
unique
(
pva
.
color
))
>
5
&&
~
prod
(
floor
(
pva
.
color
)
==
pva
.
color
)
if
length
(
unique
(
pva
.
color
))
>
5
&&
~
prod
(
floor
(
pva
.
color
)
==
pva
.
color
)
pva
.
continious
=
true
;
end
obj
.
pva
=
pva
;
end
function
ac
=
axcmp
(
data
)
function
a
x
c
=
axcmp
(
data
)
% Writes empty axcomp data struct
ac
.
prefix
=
''
;
ac
.
feature
=
ones
(
1
,
length
(
data
));
ac
.
n
=
length
(
unique
(
ac
.
feature
));
axc
.
prefix
=
''
;
axc
.
feature
=
ones
(
1
,
length
(
data
));
axc
.
n
=
length
(
unique
(
axc
.
feature
));
end
function
[
x
,
y
]
=
setlim
(
data
)
% Sets the limits for axes
x
=
[];
y
=
[];
x
=
[
min
(
data
.
x
)
max
(
data
.
x
)];
y
=
[
min
(
data
.
y
)
max
(
data
.
y
)];
...
...
@@ -71,19 +85,19 @@ function [x,y] = setlim(data)
if
abs
(
min
(
y
))/
yr
<
.
1
;
y
(
1
)
=
0
;
end
% maximum
tmp
=
max
([
x
,
y
]);
maxD
=
max
([
x
,
y
]);
order
=
0
;
scale
=
.
1
;
if
tmp
<
1
;
scale
=
10
;
end
if
maxD
<
1
;
scale
=
10
;
end
while
tmp
<
.
1
||
tmp
>
1
tmp
=
tmp
*
scale
;
while
maxD
<
.
1
||
maxD
>
1
maxD
=
maxD
*
scale
;
order
=
order
+
1
;
end
tmp
=
round
(
tmp
*
100
)/
100
;
x
(
2
)
=
tmp
*
inv
(
scale
)
^
order
;
y
(
2
)
=
tmp
*
inv
(
scale
)
^
order
;
maxD
=
round
(
maxD
*
100
)/
100
;
x
(
2
)
=
maxD
*
inv
(
scale
)
^
order
;
y
(
2
)
=
maxD
*
inv
(
scale
)
^
order
;
end
...
...
subtools/draft/@pb_draft/stat_probit.m
0 → 100644
View file @
46f4451e
function
stat_probit
(
obj
,
varargin
)
% PB_DRAFT>PB_PROBIT
%
% Creates a probit plot.
%
% OBJ.STAT_PROBIT(varargin) plots RT data and transforms axes to the classic
% probit display, i.e. cum. prob. vs promptness.
%
% See also PB_DRAFT, DRAFT, PB_PROBIT
% PBToolbox (2019): JJH: j.heckman@donders.ru.nl
v
=
varargin
;
p
.
ncol
=
pb_keyval
(
'ncol'
,
v
,
unique
(
obj
.
pva
.
color
));
p
.
visibility
=
pb_keyval
(
'visibility'
,
v
,
'off'
);
obj
.
plot_hline
;
for
iCol
=
1
:
length
(
p
.
ncol
)
obj
.
dplot
=
vertcat
(
obj
.
dplot
,{
@
(
dobj
,
data
)
probit_stat
(
dobj
,
data
,
p
,
p
.
ncol
(
iCol
))});
end
obj
.
results
.
rawdata_handle
=
{};
obj
.
pva
.
setAxes
=
false
;
end
function
h
=
probit_stat
(
~
,
data
,
p
,
colorindex
)
%% Initialize
% Read and select data.
sel
=
data
.
color
==
colorindex
;
y
=
data
.
y
(
sel
);
if
isempty
(
y
);
disp
(
'No entry for y-data found!'
);
return
;
end
gcol
=
pb_selectcolor
(
length
(
p
.
ncol
),
5
);
color
=
pb_selectcolor
(
length
(
p
.
ncol
),
data
.
def
);
color
=
color
(
colorindex
,:);
%% Rawdata
% Plot rawdata
iRT
=
1
/(
y
);
x
=
-
1.
/
sort
(
y
);
n
=
numel
(
iRT
);
y
=
probitscale
((
1
:
n
)
.
/
n
);
%h(1) = plot(x,y,'Color',gcol(colorindex,:),'Marker','o','MarkerFaceColor',gcol(colorindex,:),'LineStyle','None');
%% Quantiles & regression
p
=
[
1
,
2
,
5
,
10
,
25
,
50
,
75
,
90
95
98
99
]/
100
;
xtick
=
sort
(
-
1.
/(
150
+
[
0
pb_oct2bw
(
50
,
-
1
:
5
)]));
prob
=
sqrt
(
2
)
*
erfinv
(
2
*
p
-
1
);
q
=
-
1.
/
quantile
(
y
,
p
);
b
=
regstats
(
prob
,
q
);
rl
=
regline
(
b
.
beta
,
'k--'
);
h
=
plot
(
q
,
prob
,
'Color'
,
color
,
'Marker'
,
'o'
,
'MarkerFaceColor'
,
color
,
'LineStyle'
,
'None'
);
%set(h(1),'Tag','Rawdata');
set
(
h
,
'Tag'
,
'Probit model'
);
set
(
rl
,
'Tag'
,
'Graphical aid: regline'
);
%% Design
% Set Axis for probit
% TODO: --> FIGURE OUT WHY THE FUCK THERE IS NO VISUAL PROBIT MODEL?
%
% set(gca,'XTick',xtick,'XTickLabel',-1./xtick);
% set(gca,'YTick',prob,'YTickLabel',p*100);
% xlim([min(xtick) max(xtick)]);
% ylim([probit(0.1/100) probit(99.9/100)]);
% xlabel('Reaction time (ms)');
% ylabel('Cumulative probability');
% axis square;
% box off
end
function
chi
=
probitscale
(
cdf
)
% creates a probitscale
chi
=
sqrt
(
2
)
*
erfinv
(
2
*
cdf
-
1
);
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2019) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
subtools/draft/example_draft.m
View file @
46f4451e
...
...
@@ -4,48 +4,79 @@
pb_clean
;
% Empty
load
(
'exD_saccade'
);
% load example data
cfn
=
0
;
% Initialize current figure number
run
=
2
;
% Set # of blocks to run
run
=
3
;
% Set # of blocks to run
%% Block1:
% Make figure 1: Plot
raw
data
+ bubbleplot
%% Block
1:
% Make figure 1: Plot data
if
run
>
cfn
cfn
=
pb_newfig
(
cfn
,
'size'
,[
0
0
17
12
],
'resize'
,
'off'
);
for
i
=
1
:
1
for
j
=
1
:
2
d
(
j
,
i
)
=
pb_draft
(
'x'
,
Saccades
.
GazeLatency
,
'y'
,
Saccades
.
HeadLatency
,
'color'
,
Saccades
.
Modality
);
d
(
j
,
i
)
.
set_labels
(
'x'
,
'Gaze Latency (ms)'
,
'y'
,
'Head Latency (ms)'
);
if
~
iseven
(
i
*
j
)
d
(
j
,
i
)
.
plot_rawdata
;
else
d
(
j
,
i
)
.
plot_bubble
;
d
(
j
,
i
)
.
fit_ellipse
;
end
d
(
j
,
i
)
.
plot_dline
;
d
(
j
,
i
)
.
plot_vline
(
'type'
,
'mode'
);
d
(
j
,
i
)
.
plot_hline
(
'type'
,
'mode'
);
% Make figure & draft-obj
cfn
=
pb_newfig
(
cfn
,
'size'
,[
0
0
17
17
],
'ws'
,
'Docked'
);
d
=
pb_draft
(
'x'
,
Saccades
.
GazeLatency
,
'y'
,
Saccades
.
HeadLatency
,
'color'
,
Saccades
.
Modality
);
% Plots
d
.
plot_rawdata
d
.
plot_vline
(
'type'
,
'mode'
);
d
.
plot_hline
(
'type'
,
'mode'
);
% Layout
d
.
set_title
(
'Saccade Latencies'
);
d
.
set_labels
(
'x'
,
'Gaze Latency (ms)'
,
'y'
,
'Head Latency (ms)'
);
d
.
set_grid
;
% Build
d
.
draft
%d.print
end
%% Block 2:
% Make figure 2: Plot rawdata + bubbleplot
if
run
>
cfn
% Make figure
cfn
=
pb_newfig
(
cfn
,
'size'
,[
0
0
17
12
],
'ws'
,
'Docked'
);
for
iR
=
1
:
2
% Build draft-objs
d
(
iR
,
1
)
=
pb_draft
(
'x'
,
Saccades
.
GazeLatency
,
'y'
,
Saccades
.
HeadLatency
,
'color'
,
Saccades
.
Modality
);
% Plots
if
~
iseven
(
iR
)
d
(
iR
,
1
)
.
plot_rawdata
;
else
d
(
iR
,
1
)
.
plot_bubble
;
d
(
iR
,
1
)
.
fit_ellipse
;
end
d
(
iR
,
1
)
.
plot_dline
;
% Axis Layout
d
(
iR
,
1
)
.
set_labels
(
'x'
,
'Gaze Latency (ms)'
,
'y'
,
'Head Latency (ms)'
);
end
% Figure Layout
d
.
set_title
(
'Saccade Latencies'
);
d
.
set_axcomp
(
Saccades
.
Subject
);
d
.
set_grid
;
% Build
d
.
draft
;
d
.
print
(
'disp'
,
true
);
%
d.print
end
%% Block2:
% Make figure 2: Plot rawdata + bubbleplot
%% Block 3:
if
run
>
cfn
cfn
=
pb_newfig
(
cfn
,
'size'
,[
0
0
17
17
],
'resize'
,
'off'
);
d
=
pb_draft
(