Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mhpfiles
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Travis Seymour
mhpfiles
Commits
1f443b6a
Commit
1f443b6a
authored
2 months ago
by
Travis Seymour
Browse files
Options
Downloads
Patches
Plain Diff
updated choice task device
parent
1e536dff
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
devices/choice/choice_device.py
+98
-2
98 additions, 2 deletions
devices/choice/choice_device.py
with
98 additions
and
2 deletions
devices/choice/choice_device.py
+
98
−
2
View file @
1f443b6a
...
...
@@ -712,7 +712,7 @@ class EpicDevice(epicpy_device_base.EpicPyDevice):
capsize
=
0.1
,
ax
=
ax
,
order
=
[
"
Red
"
,
"
Green
"
,
"
Blue
"
,
"
Yellow
"
],
palette
=
[
"
C0
"
,
"
C1
"
,
"
C2
"
,
"
C3
"
],
palette
=
[
"
#00FF00
"
,
"
#0000FF
"
,
"
#FF0000
"
,
"
#FFFF00
"
],
legend
=
False
)
...
...
@@ -736,7 +736,103 @@ class EpicDevice(epicpy_device_base.EpicPyDevice):
self
.
stats_write
(
my_plot
.
get_figure
())
# Second bar plot (Eccentricity)
# --------------------------------------------------------------------------
# ** OPTIONAL GRAPH
# --------------------------------------------------------------------------
student_data_path
=
Path
(
self
.
data_filepath
.
parent
,
'
student_data.csv
'
)
if
student_data_path
.
is_file
():
try
:
student_data
=
pd
.
read_csv
(
student_data_path
)
combined
=
pd
.
concat
([
data
,
student_data
])
# create nice bar plot
fig
,
ax
=
plt
.
subplots
(
figsize
=
(
7
,
4
),
dpi
=
96
)
sns
.
set
(
style
=
"
whitegrid
"
,
color_codes
=
True
)
sns
.
set_context
(
"
paper
"
,
font_scale
=
1.5
)
# paper, notebook, talk, poster
my_plot
=
sns
.
barplot
(
x
=
"
StimColor
"
,
hue
=
"
Rules
"
,
y
=
"
RT
"
,
data
=
combined
,
capsize
=
0.1
,
ax
=
ax
,
order
=
[
"
Red
"
,
"
Green
"
,
"
Blue
"
,
"
Yellow
"
],
legend
=
True
)
highest_mean
=
int
(
max
(
combined
.
groupby
([
"
StimColor
"
,
"
Rules
"
]).
RT
.
mean
())
+
50
)
my_plot
.
set_ylim
(
150
,
highest_mean
)
ticks
=
list
(
range
(
150
,
highest_mean
+
1
,
50
))
my_plot
.
set_yticks
(
ticks
)
my_plot
.
set_yticklabels
(
ticks
)
my_plot
.
set_yticks
(
ticks
)
my_plot
.
set_yticklabels
(
ticks
)
plt
.
title
(
f
"
Mean RT by Stimulus Color Hard (Student Data)
"
)
plt
.
xlabel
(
"
Stimulus Color
"
)
plt
.
ylabel
(
"
Mean Response Time (ms)
"
)
plt
.
tight_layout
()
self
.
stats_write
(
my_plot
.
get_figure
())
except
Exception
as
e
:
self
.
stats_write
(
f
'
<br><font color=
"
Red
"
>Error while trying to create student comparison graph:
{
e
}
</font><br>
'
)
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
# ** OPTIONAL GRAPH
# --------------------------------------------------------------------------
class_data_path
=
Path
(
self
.
data_filepath
.
parent
,
'
class_data.csv
'
)
if
class_data_path
.
is_file
():
try
:
class_data
=
pd
.
read_csv
(
class_data_path
)
combined
=
pd
.
concat
([
data
,
class_data
])
# create nice bar plot
fig
,
ax
=
plt
.
subplots
(
figsize
=
(
7
,
4
),
dpi
=
96
)
sns
.
set
(
style
=
"
whitegrid
"
,
color_codes
=
True
)
sns
.
set_context
(
"
paper
"
,
font_scale
=
1.5
)
# paper, notebook, talk, poster
my_plot
=
sns
.
barplot
(
x
=
"
StimColor
"
,
hue
=
"
Rules
"
,
y
=
"
RT
"
,
data
=
combined
,
capsize
=
0.1
,
ax
=
ax
,
order
=
[
"
Red
"
,
"
Green
"
,
"
Blue
"
,
"
Yellow
"
],
legend
=
True
)
highest_mean
=
int
(
max
(
combined
.
groupby
([
"
StimColor
"
,
"
Rules
"
]).
RT
.
mean
())
+
50
)
my_plot
.
set_ylim
(
150
,
highest_mean
)
ticks
=
list
(
range
(
150
,
highest_mean
+
1
,
50
))
my_plot
.
set_yticks
(
ticks
)
my_plot
.
set_yticklabels
(
ticks
)
my_plot
.
set_yticks
(
ticks
)
my_plot
.
set_yticklabels
(
ticks
)
plt
.
title
(
f
"
Mean RT by Stimulus Color Hard (Class Data)
"
)
plt
.
xlabel
(
"
Stimulus Color
"
)
plt
.
ylabel
(
"
Mean Response Time (ms)
"
)
plt
.
tight_layout
()
self
.
stats_write
(
my_plot
.
get_figure
())
except
Exception
as
e
:
self
.
stats_write
(
f
'
<br><font color=
"
Red
"
>Error while trying to create class comparison graph:
{
e
}
</font><br>
'
)
# --------------------------------------------------------------------------
# Third bar plot (Eccentricity)
fig2
,
ax2
=
plt
.
subplots
(
figsize
=
(
7
,
4
),
dpi
=
96
)
my_eccentricity_plot
=
sns
.
barplot
(
x
=
"
StimPos
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment