Skip to content

Commit

Permalink
update spacing for metamer comparison init
Browse files Browse the repository at this point in the history
  • Loading branch information
billbrod committed Oct 9, 2024
1 parent af55028 commit 6638b04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions foveated_metamers/compose_figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,15 @@ def performance_comparison_natural(performance_fig, metamer_fig, subject_n=1,
"""
if with_initialization:
text_params, figure_width = style.plotting_style(context, 'svgutils', 'extra-wide')
figure_width = _convert_to_pix(figure_width)
figure_height = figure_width+10
else:
text_params, figure_width = style.plotting_style(context, 'svgutils', 'full')
figure_width = _convert_to_pix(figure_width)
figure_height = 1.3*figure_width+30
figure_width = _convert_to_pix(figure_width)
figure_height = 1.3*figure_width+30
# originally figured out how much to shift the text for panel B using the
# figure_width without initialization, so hopefully this works more generally
b_shift_val = (figure_height - 30) / 1.3
if subject_n is not None:
subject_n = f'n={subject_n}'
else:
Expand All @@ -429,10 +434,10 @@ def performance_comparison_natural(performance_fig, metamer_fig, subject_n=1,
compose.Text('2', 305, 115, size=n_font_size, **text_params),
compose.Text('3', 305, 200, size=n_font_size, **text_params),
compose.Text(subject_n, 80, 50, size=n_font_size, **text_params),
compose.Text('B', 0, figure_width/2, size=label_font_size, **text_params),
compose.Text('1', 0, figure_width/2+80, size=n_font_size, **text_params),
compose.Text('2', 0, figure_width/2+80+170, size=n_font_size, **text_params),
compose.Text('3', 0, figure_width/2+80+2*170, size=n_font_size, **text_params),
compose.Text('B', 0, b_shift_val/2, size=label_font_size, **text_params),
compose.Text('1', 0, b_shift_val/2+80, size=n_font_size, **text_params),
compose.Text('2', 0, b_shift_val/2+80+170, size=n_font_size, **text_params),
compose.Text('3', 0, b_shift_val/2+80+2*170, size=n_font_size, **text_params),
)


Expand Down
2 changes: 1 addition & 1 deletion foveated_metamers/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def plotting_style(context='paper', for_package='matplotlib', figsize='full'):
if context == 'paper':
params = {'font': 'Helvetica', 'size': '18pt'}
if figsize == 'extra-wide':
figure_width = '9in'
figure_width = '8.7in'
if figsize == 'full':
figure_width = '6.5in'
elif figsize == 'half':
Expand Down

0 comments on commit 6638b04

Please sign in to comment.