From 5ff9a0458fd60e8aef3269f352501782db7230fb Mon Sep 17 00:00:00 2001 From: Libby Baker Date: Sun, 12 Nov 2023 19:50:32 +0100 Subject: [PATCH 01/11] Added cvpr2024 fig size --- tests/test_rc_params_cases/case_figsizes.py | 8 ++++ tueplots/figsizes.py | 53 +++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/tests/test_rc_params_cases/case_figsizes.py b/tests/test_rc_params_cases/case_figsizes.py index 546415b..1b7efa4 100644 --- a/tests/test_rc_params_cases/case_figsizes.py +++ b/tests/test_rc_params_cases/case_figsizes.py @@ -36,6 +36,14 @@ def case_figsizes_cvpr2022_full(): return figsizes.cvpr2022_full(nrows=2, ncols=3, height_to_width_ratio=1.0) +def case_figsizes_cvpr2024_half(): + return figsizes.cvpr2024_half(nrows=2, ncols=3, height_to_width_ratio=1.0) + + +def case_figsizes_cvpr2024_full(): + return figsizes.cvpr2024_full(nrows=2, ncols=3, height_to_width_ratio=1.0) + + def case_figsizes_neurips2021(): return figsizes.neurips2021(nrows=2, ncols=3, height_to_width_ratio=1.0) diff --git a/tueplots/figsizes.py b/tueplots/figsizes.py index 5be23d1..55d85b4 100644 --- a/tueplots/figsizes.py +++ b/tueplots/figsizes.py @@ -253,6 +253,59 @@ def cvpr2022_full( ) +def cvpr2024_half( + *, + nrows=1, + ncols=1, + constrained_layout=True, + tight_layout=False, + height_to_width_ratio=_GOLDEN_RATIO, + pad_inches=_PAD_INCHES, +): + """Double-column (half-width) figures for CVPR 2022.""" + + figsize = _from_base_in( + base_width_in=3 / 14, + rel_width=1.0, + height_to_width_ratio=height_to_width_ratio, + nrows=nrows, + ncols=ncols, + ) + return _figsize_to_output_dict( + figsize=figsize, + constrained_layout=constrained_layout, + tight_layout=tight_layout, + pad_inches=pad_inches, + ) + + +def cvpr2024_full( + *, + rel_width=1.0, + nrows=1, + ncols=2, + constrained_layout=True, + tight_layout=False, + height_to_width_ratio=_GOLDEN_RATIO, + pad_inches=_PAD_INCHES, +): + """Single-column (full-width) figures for CVPR 2022.""" + + figsize = _from_base_in( + base_width_in=6 / 78, + rel_width=rel_width, + height_to_width_ratio=height_to_width_ratio, + nrows=nrows, + ncols=ncols, + ) + return _figsize_to_output_dict( + figsize=figsize, + constrained_layout=constrained_layout, + tight_layout=tight_layout, + pad_inches=pad_inches, + ) + + # Single-column formats From 424eb8d3d2ab9747348276c74a29f77a61eec7ac Mon Sep 17 00:00:00 2001 From: Libby Baker Date: Sun, 12 Nov 2023 20:26:13 +0100 Subject: [PATCH 02/11] Added cvpr2024 font size and font --- tests/test_rc_params_cases/case_fonts.py | 16 ++++++++++++++++ tests/test_rc_params_cases/case_fontsizes.py | 4 ++++ tueplots/fonts.py | 10 ++++++++++ tueplots/fontsizes.py | 7 +++++++ 4 files changed, 37 insertions(+) diff --git a/tests/test_rc_params_cases/case_fonts.py b/tests/test_rc_params_cases/case_fonts.py index 12bab90..d4192f8 100644 --- a/tests/test_rc_params_cases/case_fonts.py +++ b/tests/test_rc_params_cases/case_fonts.py @@ -130,3 +130,19 @@ def case_fonts_aistats2022_tex_custom(): def case_fonts_aistats2023_tex_custom(): return fonts.aistats2023_tex(family="serif") + + +def case_fonts_cvpr2024_default(): + return fonts.cvpr2024() + + +def case_fonts_cvpr2024_custom(): + return fonts.cvpr2024(family="serif") + + +def case_fonts_cvpr2024_tex_default(): + return fonts.cvpr2024_tex() + + +def case_fonts_cvpr2024_tex_custom(): + return fonts.cvpr2024_tex(family="serif") diff --git a/tests/test_rc_params_cases/case_fontsizes.py b/tests/test_rc_params_cases/case_fontsizes.py index 1347318..2b76e18 100644 --- a/tests/test_rc_params_cases/case_fontsizes.py +++ b/tests/test_rc_params_cases/case_fontsizes.py @@ -3,6 +3,10 @@ from tueplots import fontsizes +def case_fontsizes_cvpr2024(): + return fontsizes.cvpr2024() + + def case_fontsizes_icml2022(): return fontsizes.icml2022() diff --git a/tueplots/fonts.py b/tueplots/fonts.py index 8bd3dbc..eb7d0e2 100644 --- a/tueplots/fonts.py +++ b/tueplots/fonts.py @@ -51,6 +51,16 @@ def iclr2024(*, family="serif"): return _neurips_and_iclr_common(family=family) +def cvpr2024_tex(*, family="serif"): + """Fonts for ICLR 2024. LaTeX version.""" + return _neurips_and_iclr_tex_common(family=family) + + +def cvpr2024(*, family="serif"): + """Fonts for ICLR 2023. LaTeX version.""" + return _neurips_and_iclr_common(family=family) + + def _neurips_and_iclr_common(*, family="serif"): """Default fonts for Neurips.""" return { diff --git a/tueplots/fontsizes.py b/tueplots/fontsizes.py index cb3b229..f6932b1 100644 --- a/tueplots/fontsizes.py +++ b/tueplots/fontsizes.py @@ -11,6 +11,13 @@ def icml2022(*, default_smaller=1): return _from_base(base=9 - default_smaller) +def cvpr2024(*, default_smaller=1): + """Font size for CVPR 2024.""" + # CVPR text size is 10, but captions are in size 9. + # Therefore, we use base 9 instead of 10. + return _from_base(base=9 - default_smaller) + + def neurips2021(*, default_smaller=1): """Font size for Neurips 2021.""" return _from_base(base=10 - default_smaller) From 212d85ab4d9e15f88f7eb8cbe322268d4de3e224 Mon Sep 17 00:00:00 2001 From: Libby Baker Date: Sun, 12 Nov 2023 20:44:46 +0100 Subject: [PATCH 03/11] Updated fig size --- tueplots/figsizes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tueplots/figsizes.py b/tueplots/figsizes.py index 55d85b4..e467808 100644 --- a/tueplots/figsizes.py +++ b/tueplots/figsizes.py @@ -265,7 +265,7 @@ def cvpr2024_half( """Double-column (half-width) figures for CVPR 2022.""" figsize = _from_base_in( - base_width_in=3 / 14, + base_width_in=3 + 1 / 4, rel_width=1.0, height_to_width_ratio=height_to_width_ratio, nrows=nrows, @@ -292,7 +292,7 @@ def cvpr2024_full( """Single-column (full-width) figures for CVPR 2022.""" figsize = _from_base_in( - base_width_in=6 / 78, + base_width_in=6 + 7 / 8, rel_width=rel_width, height_to_width_ratio=height_to_width_ratio, nrows=nrows, From 362271d4388e221fd48167c785481c65979f6f08 Mon Sep 17 00:00:00 2001 From: Libby Baker Date: Sun, 12 Nov 2023 20:52:05 +0100 Subject: [PATCH 04/11] Added cvpr2024 bundle --- tests/test_rc_params_cases/case_bundles.py | 8 ++++++++ tueplots/bundles.py | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/tests/test_rc_params_cases/case_bundles.py b/tests/test_rc_params_cases/case_bundles.py index 6d38976..6966f2e 100644 --- a/tests/test_rc_params_cases/case_bundles.py +++ b/tests/test_rc_params_cases/case_bundles.py @@ -5,6 +5,14 @@ from tueplots import bundles +@pytest_cases.parametrize(column=["full", "half"]) +@pytest_cases.parametrize(usetex=[True, False]) +def case_bundles_cvpr2024(column, usetex): + return bundles.cvpr2024( + nrows=2, ncols=2, family="serif", column=column, usetex=usetex + ) + + @pytest_cases.parametrize(column=["full", "half"]) @pytest_cases.parametrize(usetex=[True, False]) def case_bundles_icml2022(column, usetex): diff --git a/tueplots/bundles.py b/tueplots/bundles.py index 6bb974c..8c8cacc 100644 --- a/tueplots/bundles.py +++ b/tueplots/bundles.py @@ -4,6 +4,20 @@ from tueplots.constants.color import palettes, rgb +def cvpr2024(*, column="half", nrows=1, ncols=1, usetex=True, family="serif"): + """ICML 2022 bundle.""" + if column == "half": + size = figsizes.cvpr2024_half(nrows=nrows, ncols=ncols) + elif column == "full": + size = figsizes.cvpr2024_full(nrows=nrows, ncols=ncols) + if usetex is True: + font_config = fonts.cvpr2024_tex(family=family) + elif usetex is False: + font_config = fonts.cvpr2024(family=family) + fontsize_config = fontsizes.cvpr2024() + return {**font_config, **size, **fontsize_config} + + def icml2022(*, column="half", nrows=1, ncols=1, usetex=True, family="serif"): """ICML 2022 bundle.""" if column == "half": From 42f8d2b185b916f4f8bce60864c625ec6d66ee3f Mon Sep 17 00:00:00 2001 From: libbylbaker <105348570+libbylbaker@users.noreply.github.com> Date: Sun, 12 Nov 2023 21:15:31 +0100 Subject: [PATCH 05/11] Update tueplots/bundles.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nicholas Krämer --- tueplots/bundles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tueplots/bundles.py b/tueplots/bundles.py index 8c8cacc..bace65a 100644 --- a/tueplots/bundles.py +++ b/tueplots/bundles.py @@ -5,7 +5,7 @@ def cvpr2024(*, column="half", nrows=1, ncols=1, usetex=True, family="serif"): - """ICML 2022 bundle.""" + """CVPR 2024 bundle.""" if column == "half": size = figsizes.cvpr2024_half(nrows=nrows, ncols=ncols) elif column == "full": From 619cf20906cfe3c04bf6e0643177c6428df67c41 Mon Sep 17 00:00:00 2001 From: libbylbaker <105348570+libbylbaker@users.noreply.github.com> Date: Sun, 12 Nov 2023 21:16:43 +0100 Subject: [PATCH 06/11] Update tueplots/figsizes.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nicholas Krämer --- tueplots/figsizes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tueplots/figsizes.py b/tueplots/figsizes.py index e467808..e825c77 100644 --- a/tueplots/figsizes.py +++ b/tueplots/figsizes.py @@ -262,7 +262,7 @@ def cvpr2024_half( height_to_width_ratio=_GOLDEN_RATIO, pad_inches=_PAD_INCHES, ): - """Double-column (half-width) figures for CVPR 2022.""" + """Double-column (half-width) figures for CVPR 2024.""" figsize = _from_base_in( base_width_in=3 + 1 / 4, From 31f610fdb5e6c78bb546ab69d4a12707e51f6a2f Mon Sep 17 00:00:00 2001 From: libbylbaker <105348570+libbylbaker@users.noreply.github.com> Date: Sun, 12 Nov 2023 21:16:49 +0100 Subject: [PATCH 07/11] Update tueplots/figsizes.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nicholas Krämer --- tueplots/figsizes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tueplots/figsizes.py b/tueplots/figsizes.py index e825c77..6b6b757 100644 --- a/tueplots/figsizes.py +++ b/tueplots/figsizes.py @@ -289,7 +289,7 @@ def cvpr2024_full( height_to_width_ratio=_GOLDEN_RATIO, pad_inches=_PAD_INCHES, ): - """Single-column (full-width) figures for CVPR 2022.""" + """Single-column (full-width) figures for CVPR 2024.""" figsize = _from_base_in( base_width_in=6 + 7 / 8, From 378a2387d33310dbb72859f16758bab4dc55f344 Mon Sep 17 00:00:00 2001 From: libbylbaker <105348570+libbylbaker@users.noreply.github.com> Date: Sun, 12 Nov 2023 21:16:53 +0100 Subject: [PATCH 08/11] Update tueplots/fonts.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nicholas Krämer --- tueplots/fonts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tueplots/fonts.py b/tueplots/fonts.py index eb7d0e2..651b296 100644 --- a/tueplots/fonts.py +++ b/tueplots/fonts.py @@ -52,7 +52,7 @@ def iclr2024(*, family="serif"): def cvpr2024_tex(*, family="serif"): - """Fonts for ICLR 2024. LaTeX version.""" + """Fonts for CVPR 2024. LaTeX version.""" return _neurips_and_iclr_tex_common(family=family) From df13e82654f7c7e328902dbf5572d1cd116ae4a0 Mon Sep 17 00:00:00 2001 From: libbylbaker <105348570+libbylbaker@users.noreply.github.com> Date: Sun, 12 Nov 2023 21:16:59 +0100 Subject: [PATCH 09/11] Update tueplots/fonts.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nicholas Krämer --- tueplots/fonts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tueplots/fonts.py b/tueplots/fonts.py index 651b296..e812066 100644 --- a/tueplots/fonts.py +++ b/tueplots/fonts.py @@ -57,7 +57,7 @@ def cvpr2024_tex(*, family="serif"): def cvpr2024(*, family="serif"): - """Fonts for ICLR 2023. LaTeX version.""" + """Fonts for CVPR 2024. LaTeX version.""" return _neurips_and_iclr_common(family=family) From ad2ee070a37c3591239735eb255d0fae2b6d7d6e Mon Sep 17 00:00:00 2001 From: libbylbaker <105348570+libbylbaker@users.noreply.github.com> Date: Sun, 12 Nov 2023 21:17:04 +0100 Subject: [PATCH 10/11] Update tueplots/figsizes.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nicholas Krämer --- tueplots/figsizes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tueplots/figsizes.py b/tueplots/figsizes.py index 6b6b757..fcca559 100644 --- a/tueplots/figsizes.py +++ b/tueplots/figsizes.py @@ -265,7 +265,7 @@ def cvpr2024_half( """Double-column (half-width) figures for CVPR 2024.""" figsize = _from_base_in( - base_width_in=3 + 1 / 4, + base_width_in=3.25, rel_width=1.0, height_to_width_ratio=height_to_width_ratio, nrows=nrows, From 4ae107f5f4bf5162114cc06c4e15149c172439a4 Mon Sep 17 00:00:00 2001 From: libbylbaker <105348570+libbylbaker@users.noreply.github.com> Date: Sun, 12 Nov 2023 21:17:10 +0100 Subject: [PATCH 11/11] Update tueplots/figsizes.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nicholas Krämer --- tueplots/figsizes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tueplots/figsizes.py b/tueplots/figsizes.py index fcca559..bfb123a 100644 --- a/tueplots/figsizes.py +++ b/tueplots/figsizes.py @@ -292,7 +292,7 @@ def cvpr2024_full( """Single-column (full-width) figures for CVPR 2024.""" figsize = _from_base_in( - base_width_in=6 + 7 / 8, + base_width_in=6.875, rel_width=rel_width, height_to_width_ratio=height_to_width_ratio, nrows=nrows,