Skip to content
Snippets Groups Projects
Commit 1f443b6a authored by Travis Seymour's avatar Travis Seymour
Browse files

updated choice task device

parent 1e536dff
No related branches found
No related tags found
No related merge requests found
......@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment