Skip to content

Commit

Permalink
adds gridlines to critical sclaing pointplot
Browse files Browse the repository at this point in the history
  • Loading branch information
billbrod committed Nov 8, 2024
1 parent 57804bd commit e10c20c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4518,6 +4518,11 @@ rule critical_scaling_pointplot:
with open(log[0], 'w', buffering=1) as log_file:
with contextlib.redirect_stdout(log_file), contextlib.redirect_stderr(log_file):
style, fig_width = fov.style.plotting_style(wildcards.context, figsize='half')
# some modifications to the style, because we want the gridlines
mpl.rcParams['axes.grid'] = True
mpl.rcParams['axes.grid.axis'] = 'y'
mpl.rcParams['axes.grid.which'] = 'both'
mpl.rcParams['axes.axisbelow'] = True
crit_scaling = []
for f in input:
tmp = az.from_netcdf(f)
Expand Down
4 changes: 2 additions & 2 deletions foveated_metamers/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -2165,8 +2165,8 @@ def vertical_pointplot(data, x, y, norm_y=False, **kwargs):
data = data.groupby(['model', 'trial_type']).critical_scaling.mean().reset_index()
if norm_y:
data[y] = data[y] / data[y].min()
# want the line to be under the points, so set zorder=0
ax.plot(data[x].values, data[y].values, linewidth=lw, zorder=0, **kwargs)
# want the line to be under the points but above the gridlines
ax.plot(data[x].values, data[y].values, linewidth=lw, zorder=1, **kwargs)
if kwargs['label'] == 'Luminance\n(this study)':
marker = {'metamer_vs_reference': 'o', 'metamer_vs_metamer': r'$\bigwedge$'}
else:
Expand Down

0 comments on commit e10c20c

Please sign in to comment.