Skip to content

Commit

Permalink
adding fixed x scale to kernels_by_cre
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpiet committed Feb 23, 2023
1 parent 1f92836 commit e1b5759
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
17 changes: 11 additions & 6 deletions visual_behavior_glm/GLM_strategy_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,17 @@ def kernels_by_cre(weights_beh, run_params, kernel='omissions',
post_horz_offset = 2.5
vertical_offset = .75
fig = plt.figure(figsize=(width,height))
if kernel == 'all_images':
h = [Size.Fixed(pre_horz_offset),\
Size.Fixed((width-pre_horz_offset-post_horz_offset)/3*.75)]
else:
h = [Size.Fixed(pre_horz_offset),\
Size.Fixed(width-pre_horz_offset-post_horz_offset)]

duration = run_params['kernels'][kernel]['length']
h = [Size.Fixed(pre_horz_offset),\
Size.Fixed((width-pre_horz_offset-post_horz_offset)/3*duration)]

#if kernel == 'all-images':
# h = [Size.Fixed(pre_horz_offset),\
# Size.Fixed((width-pre_horz_offset-post_horz_offset)/3*.75)]
#else:
# h = [Size.Fixed(pre_horz_offset),\
# Size.Fixed(width-pre_horz_offset-post_horz_offset)]
v = [Size.Fixed(vertical_offset),Size.Fixed(height-vertical_offset-.5)]
divider = Divider(fig, (0,0,1,1),h,v,aspect=False)
ax = fig.add_axes(divider.get_position(),\
Expand Down
6 changes: 4 additions & 2 deletions visual_behavior_glm/strategy_paper_figure_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@
gpt.analysis(weights_beh, run_params, 'misses')

# Plot kernels over time, compare strategies
gst.kernels_by_cre(weights_beh, run_params)

gst.kernels_by_cre(weights_beh, run_params, 'all-images')
gst.kernels_by_cre(weights_beh, run_params, 'omissions')
gst.kernels_by_cre(weights_beh, run_params, 'hits')
gst.kernels_by_cre(weights_beh, run_params, 'misses')

## Fig. 6 Engagement PSTHs
################################################################################
Expand Down

0 comments on commit e1b5759

Please sign in to comment.