mpl-spaceplot 0.2.1__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mpl_spaceplot-0.2.1/src/mpl_spaceplot.egg-info → mpl_spaceplot-0.3.0}/PKG-INFO +1 -1
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/pyproject.toml +1 -1
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0/src/mpl_spaceplot.egg-info}/PKG-INFO +1 -1
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/mpl_spaceplot.egg-info/SOURCES.txt +1 -0
- mpl_spaceplot-0.2.1/src/spaceplot/appearance/layout.py → mpl_spaceplot-0.3.0/src/spaceplot/appearance/_layout.py +2 -3
- mpl_spaceplot-0.3.0/src/spaceplot/appearance/layout.py +378 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/decorators/decorators.py +1 -1
- mpl_spaceplot-0.3.0/src/spaceplot/utils.py +165 -0
- mpl_spaceplot-0.2.1/src/spaceplot/utils.py +0 -48
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/LICENSE +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/README.md +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/setup.cfg +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/mpl_spaceplot.egg-info/dependency_links.txt +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/mpl_spaceplot.egg-info/requires.txt +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/mpl_spaceplot.egg-info/top_level.txt +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/__init__.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/aligner.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/appearance/__init__.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/appearance/display.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/appearance/inline.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/appearance/palettes.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/appearance/styles.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/appearance/tools.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/decorators/__init__.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/decorators/tools.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/montage_plot.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/plotting/__init__.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/plotting/plotting.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/plotting/tools.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/font_loader.py +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraCode/FiraCode-Bold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraCode/FiraCode-Light.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraCode/FiraCode-Medium.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraCode/FiraCode-Regular.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraCode/FiraCode-SemiBold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraMath/FiraMath-Bold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraMath/FiraMath-ExtraLight.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraMath/FiraMath-Heavy.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraMath/FiraMath-Light.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraMath/FiraMath-Medium.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraMath/FiraMath-Regular.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraMath/FiraMath-SemiBold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraMath/FiraMath-UltraLight.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-Black.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-BlackItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-Bold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-BoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-ExtraBold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-ExtraBoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-ExtraLight.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-ExtraLightItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-Italic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-Light.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-LightItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-Medium.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-MediumItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-Regular.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-SemiBold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-SemiBoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-Black.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-BlackItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-Bold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-BoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-Italic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-Light.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-LightItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-Regular.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-Thin.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-ThinItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/NotoSans/NotoSans-Bold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/NotoSans/NotoSans-BoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/NotoSans/NotoSans-Italic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/NotoSans/NotoSans-Regular.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/NotoSerif/NotoSerif-Bold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/NotoSerif/NotoSerif-BoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/NotoSerif/NotoSerif-Italic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/NotoSerif/NotoSerif-Regular.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/OpenSans/OpenSans-Bold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/OpenSans/OpenSans-BoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/OpenSans/OpenSans-Italic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/OpenSans/OpenSans-Regular.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/OpenSans/OpenSans-Semibold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/OpenSans/OpenSans-SemiboldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Black.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Bold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Italic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Light.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Medium.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Regular.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Thin.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/RobotoCondensed-Bold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/RobotoCondensed-BoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/RobotoCondensed-Italic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/RobotoCondensed-Light.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/RobotoCondensed-LightItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/RobotoCondensed-Regular.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSans/SourceSansPro-Black.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSans/SourceSansPro-BlackItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSans/SourceSansPro-Bold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSans/SourceSansPro-BoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSans/SourceSansPro-ExtraLight.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSans/SourceSansPro-ExtraLightItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSans/SourceSansPro-Italic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSans/SourceSansPro-Light.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSans/SourceSansPro-LightItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSans/SourceSansPro-Regular.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSans/SourceSansPro-SemiBold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSans/SourceSansPro-SemiBoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSerif/SourceSerifPro-Black.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSerif/SourceSerifPro-BlackItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSerif/SourceSerifPro-Bold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSerif/SourceSerifPro-BoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSerif/SourceSerifPro-ExtraLight.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSerif/SourceSerifPro-ExtraLightItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSerif/SourceSerifPro-Italic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSerif/SourceSerifPro-Light.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSerif/SourceSerifPro-LightItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSerif/SourceSerifPro-Regular.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSerif/SourceSerifPro-SemiBold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/SourceSerif/SourceSerifPro-SemiBoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Ubuntu/Ubuntu-Bold.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Ubuntu/Ubuntu-BoldItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Ubuntu/Ubuntu-Italic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Ubuntu/Ubuntu-Light.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Ubuntu/Ubuntu-LightItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Ubuntu/Ubuntu-Medium.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Ubuntu/Ubuntu-MediumItalic.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Ubuntu/Ubuntu-Regular.ttf +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/palettes/pal1.txt +0 -0
- {mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/simulate_data.py +0 -0
|
@@ -12,6 +12,7 @@ src/spaceplot/montage_plot.py
|
|
|
12
12
|
src/spaceplot/simulate_data.py
|
|
13
13
|
src/spaceplot/utils.py
|
|
14
14
|
src/spaceplot/appearance/__init__.py
|
|
15
|
+
src/spaceplot/appearance/_layout.py
|
|
15
16
|
src/spaceplot/appearance/display.py
|
|
16
17
|
src/spaceplot/appearance/inline.py
|
|
17
18
|
src/spaceplot/appearance/layout.py
|
|
@@ -15,7 +15,7 @@ def layout(
|
|
|
15
15
|
axs,
|
|
16
16
|
*,
|
|
17
17
|
axis: str = 'both',
|
|
18
|
-
title: str = None,
|
|
18
|
+
title: str | list = None,
|
|
19
19
|
x_label: str = None,
|
|
20
20
|
y_label: str = None,
|
|
21
21
|
abc: str | bool = None,
|
|
@@ -47,7 +47,7 @@ def layout(
|
|
|
47
47
|
# ensure axs is a list
|
|
48
48
|
if not isinstance(axs, Iterable):
|
|
49
49
|
axs = [axs]
|
|
50
|
-
if not isinstance(title,
|
|
50
|
+
if not isinstance(title, list):
|
|
51
51
|
title = [title]
|
|
52
52
|
|
|
53
53
|
handle_abc_labels(axs, abc, **kwargs)
|
|
@@ -93,7 +93,6 @@ def handle_abc_labels(axs, abc=None, **kwargs):
|
|
|
93
93
|
decs.place_abc_label(
|
|
94
94
|
ax,
|
|
95
95
|
label=ax_labels[i],
|
|
96
|
-
pad=0.2,
|
|
97
96
|
**abc_params,
|
|
98
97
|
)
|
|
99
98
|
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
from collections.abc import Iterable
|
|
2
|
+
from itertools import cycle
|
|
3
|
+
from typing import Literal
|
|
4
|
+
|
|
5
|
+
import numpy as np
|
|
6
|
+
|
|
7
|
+
from .. import decorators as decs
|
|
8
|
+
from .. import utils
|
|
9
|
+
from . import tools
|
|
10
|
+
|
|
11
|
+
_tick_vis = Literal[True, False, '1', '2', 'both', 'all', None]
|
|
12
|
+
_grid_vis = Literal[True, False, 'both', 'major', 'minor', None]
|
|
13
|
+
_spine_vis = Literal[True, False, 'top', 'bottom', 'left', 'right', None]
|
|
14
|
+
|
|
15
|
+
major_grid_style = 'solid'
|
|
16
|
+
minor_grid_style = (0, (1, 2))
|
|
17
|
+
|
|
18
|
+
# TODO tick param hygiene... there are likely some grid, tick, minor params that don't belong
|
|
19
|
+
# I think currently, tick visibility will override settings from other setters... need to fix that
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def layout(
|
|
23
|
+
axs,
|
|
24
|
+
*,
|
|
25
|
+
title: str | list = None,
|
|
26
|
+
abc: str | bool = None,
|
|
27
|
+
margins: float = None,
|
|
28
|
+
aspect: str | float | tuple = None,
|
|
29
|
+
ticks: _tick_vis = None,
|
|
30
|
+
spines: _spine_vis = None,
|
|
31
|
+
grid: _grid_vis = None,
|
|
32
|
+
minor: bool = None,
|
|
33
|
+
label: str = None,
|
|
34
|
+
breaks: list[float] = None,
|
|
35
|
+
lims: list[float] = None,
|
|
36
|
+
scale: str = None,
|
|
37
|
+
ticklabels: list[str] = None,
|
|
38
|
+
**kwargs,
|
|
39
|
+
):
|
|
40
|
+
local_args = {
|
|
41
|
+
k: v
|
|
42
|
+
for k, v in {
|
|
43
|
+
'label': label,
|
|
44
|
+
'margins': margins,
|
|
45
|
+
'breaks': breaks,
|
|
46
|
+
'lims': lims,
|
|
47
|
+
'scale': scale,
|
|
48
|
+
'ticklabels': ticklabels,
|
|
49
|
+
}.items()
|
|
50
|
+
if v is not None
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
merged = {**local_args, **kwargs}
|
|
54
|
+
|
|
55
|
+
axis_params, static_kwargs = merge_axis_kwargs(merged)
|
|
56
|
+
x_label_params, x_tick_params, x_params = compile_axis_settings(axis_params, axis='x')
|
|
57
|
+
y_label_params, y_tick_params, y_params = compile_axis_settings(axis_params, axis='y')
|
|
58
|
+
|
|
59
|
+
title_settings = utils.get_hook_dict_v2(static_kwargs, 'title_', remove_hook=True)
|
|
60
|
+
|
|
61
|
+
# ensure axs is a list
|
|
62
|
+
if not isinstance(axs, Iterable):
|
|
63
|
+
axs = [axs]
|
|
64
|
+
if not isinstance(title, list):
|
|
65
|
+
title = [title]
|
|
66
|
+
|
|
67
|
+
handle_abc_labels(axs, abc, **kwargs)
|
|
68
|
+
|
|
69
|
+
pairs = list(zip(axs, cycle(title)))
|
|
70
|
+
|
|
71
|
+
for ax, title in pairs:
|
|
72
|
+
viz(ax, ticks=ticks, grid=grid, minor=minor, **kwargs)
|
|
73
|
+
|
|
74
|
+
handle_tick_settings(ax, 'y', y_tick_params)
|
|
75
|
+
handle_tick_settings(ax, 'x', x_tick_params)
|
|
76
|
+
|
|
77
|
+
# handle other layout elements
|
|
78
|
+
handle_title(ax, title, title_settings)
|
|
79
|
+
handle_text_element(ax.get_xlabel, ax.set_xlabel, x_params['label'], x_label_params)
|
|
80
|
+
handle_text_element(ax.get_ylabel, ax.set_ylabel, y_params['label'], y_label_params)
|
|
81
|
+
|
|
82
|
+
handle_spines(ax, spines)
|
|
83
|
+
handle_breaks(ax, x_params['breaks'], y_params['breaks'])
|
|
84
|
+
handle_scales(ax, x_params['scale'], y_params['scale'])
|
|
85
|
+
handle_lims(ax, x_params['lims'], y_params['lims'])
|
|
86
|
+
|
|
87
|
+
handle_tick_labels(ax, x_params['ticklabels'], y_params['ticklabels'])
|
|
88
|
+
|
|
89
|
+
handle_aspect(ax, aspect)
|
|
90
|
+
|
|
91
|
+
# ly.handle_margins(ax, margins, make_square)
|
|
92
|
+
ax.set_xmargin(x_params['margins']) if x_params['margins'] is not None else None
|
|
93
|
+
ax.set_ymargin(y_params['margins']) if y_params['margins'] is not None else None
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def viz(
|
|
97
|
+
ax,
|
|
98
|
+
*,
|
|
99
|
+
ticks: _tick_vis = None,
|
|
100
|
+
grid: _grid_vis = None,
|
|
101
|
+
minor: _tick_vis = None,
|
|
102
|
+
**kwargs,
|
|
103
|
+
):
|
|
104
|
+
def value_check(param, value):
|
|
105
|
+
if value is None:
|
|
106
|
+
return
|
|
107
|
+
if type(value) is bool:
|
|
108
|
+
return
|
|
109
|
+
if value not in [v for v in _tick_vis.__args__ if type(v) is str]:
|
|
110
|
+
raise ValueError(f'Invalid {param} param: {value} ')
|
|
111
|
+
|
|
112
|
+
value_check('ticks', ticks)
|
|
113
|
+
value_check('minor', minor)
|
|
114
|
+
for k, v in kwargs.items():
|
|
115
|
+
if k.endswith('_ticks'):
|
|
116
|
+
value_check(k, v)
|
|
117
|
+
if k.endswith('_minor'):
|
|
118
|
+
value_check(k, v)
|
|
119
|
+
|
|
120
|
+
viz_args = {
|
|
121
|
+
k: v
|
|
122
|
+
for k, v in {
|
|
123
|
+
'ticks': ticks,
|
|
124
|
+
'grid': grid,
|
|
125
|
+
'minor': minor,
|
|
126
|
+
}.items()
|
|
127
|
+
if v is not None
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
ax_below = False if 'grid_zorder' in kwargs else True
|
|
131
|
+
ax.set_axisbelow(ax_below)
|
|
132
|
+
|
|
133
|
+
# filter kwargs and merge with args to a single dict
|
|
134
|
+
viz_kwargs = {k: v for k, v in kwargs.items() if any([k.endswith(h) for h in ['_ticks', '_grid', '_minor']])}
|
|
135
|
+
merged = {**viz_args, **viz_kwargs}
|
|
136
|
+
|
|
137
|
+
# break down merged into x_ and y_ specific params
|
|
138
|
+
viz_params = parse_axis_params(params=merged)
|
|
139
|
+
xviz = utils.get_hook_dict_v2(viz_params, 'x_', remove_hook=True, check=False)
|
|
140
|
+
yviz = utils.get_hook_dict_v2(viz_params, 'y_', remove_hook=True, check=False)
|
|
141
|
+
|
|
142
|
+
# apply settings
|
|
143
|
+
set_tick_grid_visibility(ax, axis='x', **xviz)
|
|
144
|
+
set_tick_grid_visibility(ax, axis='y', **yviz)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def set_tick_grid_visibility(ax, *, axis='x', ticks=None, minor=False, grid=None):
|
|
148
|
+
axis_obj = getattr(ax, f'{axis}axis')
|
|
149
|
+
|
|
150
|
+
# mapping for tick visibility in x/y axis
|
|
151
|
+
p1 = 'bottom' if axis == 'x' else 'left'
|
|
152
|
+
p2 = 'top' if axis == 'x' else 'right'
|
|
153
|
+
|
|
154
|
+
keys = [p1, f'label{p1}', p2, f'label{p2}']
|
|
155
|
+
curr_params = axis_obj.get_tick_params()
|
|
156
|
+
curr_params = {k: v for k, v in curr_params.items() if k in keys}
|
|
157
|
+
|
|
158
|
+
# this determines the logic for tick visibility
|
|
159
|
+
def apply_logic(value):
|
|
160
|
+
logic_1 = True if value in ('1', 'both', 'all', True) else False
|
|
161
|
+
logic_2 = True if value in ('2', 'both', 'all') else False
|
|
162
|
+
|
|
163
|
+
viz = {
|
|
164
|
+
p1: logic_1,
|
|
165
|
+
f'label{p1}': logic_1,
|
|
166
|
+
p2: logic_2,
|
|
167
|
+
f'label{p2}': logic_2,
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return viz
|
|
171
|
+
|
|
172
|
+
if ticks is None:
|
|
173
|
+
viz = curr_params
|
|
174
|
+
else:
|
|
175
|
+
viz = apply_logic(ticks)
|
|
176
|
+
|
|
177
|
+
if minor is None and ticks is None:
|
|
178
|
+
viz_min = {}
|
|
179
|
+
elif minor is None and ticks:
|
|
180
|
+
viz_min = {}
|
|
181
|
+
elif minor is True and not ticks:
|
|
182
|
+
viz_min = curr_params
|
|
183
|
+
elif minor is True and ticks:
|
|
184
|
+
viz_min = viz.copy()
|
|
185
|
+
else:
|
|
186
|
+
viz_min = apply_logic(minor)
|
|
187
|
+
|
|
188
|
+
axis_obj.minorticks_on()
|
|
189
|
+
grid_maj, grid_min = parse_grid_visibility(grid=grid, minor=minor)
|
|
190
|
+
|
|
191
|
+
axis_obj.set_tick_params(which='major', gridOn=grid_maj, **viz)
|
|
192
|
+
axis_obj.set_tick_params(which='minor', gridOn=grid_min, **viz_min)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def parse_grid_visibility(
|
|
196
|
+
grid: _grid_vis | None = None,
|
|
197
|
+
minor: bool | None = None,
|
|
198
|
+
):
|
|
199
|
+
if grid is None:
|
|
200
|
+
return None, None
|
|
201
|
+
|
|
202
|
+
if isinstance(grid, bool):
|
|
203
|
+
if not grid:
|
|
204
|
+
major_setter = minor_setter = False
|
|
205
|
+
else:
|
|
206
|
+
major_setter = grid
|
|
207
|
+
minor_setter = grid if minor is None else minor
|
|
208
|
+
elif isinstance(grid, str):
|
|
209
|
+
major_setter = True if grid in ('both', 'major') else False
|
|
210
|
+
minor_setter = True if grid in ('both', 'minor') else False
|
|
211
|
+
|
|
212
|
+
return major_setter, minor_setter
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def parse_axis_params(params: dict):
|
|
216
|
+
"""
|
|
217
|
+
separates explicit axis params (i.e: x_tick_size) from global axis params (i.e: tick_size)
|
|
218
|
+
and merges them into a single dict of xy related axis params
|
|
219
|
+
"""
|
|
220
|
+
specific_axis_params = {}
|
|
221
|
+
global_axis_params = {}
|
|
222
|
+
for key, value in params.items():
|
|
223
|
+
if any([key.startswith(h) for h in ['x_', 'y_']]):
|
|
224
|
+
specific_axis_params[key] = value
|
|
225
|
+
else:
|
|
226
|
+
global_axis_params[key] = value
|
|
227
|
+
|
|
228
|
+
# 3: expand global axis params to x_ and y_ versions
|
|
229
|
+
x_global = {'x_' + key: value for key, value in global_axis_params.items()}
|
|
230
|
+
y_global = {'y_' + key: value for key, value in global_axis_params.items()}
|
|
231
|
+
axis_global = {**x_global, **y_global}
|
|
232
|
+
|
|
233
|
+
# 4: check for duplicates and merge
|
|
234
|
+
duplicate_keys = set(specific_axis_params.keys()) & set(axis_global.keys())
|
|
235
|
+
if duplicate_keys:
|
|
236
|
+
param_names = [p.removeprefix('x_') if p.startswith('x_') else p.removeprefix('y_') for p in duplicate_keys]
|
|
237
|
+
raise ValueError(f'Duplicate axis param for: {duplicate_keys} and {param_names}')
|
|
238
|
+
|
|
239
|
+
axis_params = {**specific_axis_params, **axis_global}
|
|
240
|
+
|
|
241
|
+
return axis_params
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
def merge_axis_kwargs(kwargs):
|
|
245
|
+
axis_hooks = ['x_', 'y_', 'tick_', 'margins', 'grid', 'label', 'lims', 'breaks', 'scale', 'ticklabels']
|
|
246
|
+
# 1: separate axis and static params
|
|
247
|
+
axis_params = {}
|
|
248
|
+
static_params = {}
|
|
249
|
+
for key, value in kwargs.items():
|
|
250
|
+
if any([key.startswith(h) for h in axis_hooks]):
|
|
251
|
+
axis_params[key] = value
|
|
252
|
+
else:
|
|
253
|
+
static_params[key] = value
|
|
254
|
+
|
|
255
|
+
axis_params = parse_axis_params(axis_params)
|
|
256
|
+
|
|
257
|
+
return axis_params, static_params
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
def compile_axis_settings(axis_params, axis: str) -> dict:
|
|
261
|
+
settings = utils.get_hook_dict_v2(axis_params, f'{axis}_', remove_hook=True, check=False)
|
|
262
|
+
|
|
263
|
+
tick_settings = utils.get_hook_dict_v2(settings, 'tick_', remove_hook=True)
|
|
264
|
+
grid_settings = utils.get_hook_dict_v2(settings, 'grid_', remove_hook=False)
|
|
265
|
+
label_settings = utils.get_hook_dict_v2(settings, 'label_', remove_hook=True)
|
|
266
|
+
|
|
267
|
+
tick_settings.update(grid_settings)
|
|
268
|
+
other_params = {k: v for k, v in settings.items() if not (k.startswith('tick_') or k.startswith('grid_'))}
|
|
269
|
+
|
|
270
|
+
complete_other = {}
|
|
271
|
+
for i in ['grid', 'margins', 'label', 'breaks', 'lims', 'scale', 'ticklabels']:
|
|
272
|
+
complete_other[i] = other_params.get(i, None)
|
|
273
|
+
|
|
274
|
+
return label_settings, tick_settings, complete_other
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def handle_text_element(getter, setter, text: str = None, params: dict = {}):
|
|
278
|
+
"""Generic helper to get current text if needed and set it with params."""
|
|
279
|
+
if text is None and len(params) == 0:
|
|
280
|
+
return
|
|
281
|
+
|
|
282
|
+
if text is None and len(params) > 0:
|
|
283
|
+
text = getter()
|
|
284
|
+
|
|
285
|
+
setter(text, **params)
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
def handle_title(ax, title, title_params):
|
|
289
|
+
if title is None and len(title_params) == 0:
|
|
290
|
+
return
|
|
291
|
+
|
|
292
|
+
if title is None:
|
|
293
|
+
title = ax.get_title()
|
|
294
|
+
title = None if len(title) == 0 else title
|
|
295
|
+
|
|
296
|
+
if title is not None or len(title_params) > 0:
|
|
297
|
+
handle_text_element(ax.get_title, ax.set_title, title, title_params)
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
def handle_tick_labels(ax, x_tick_labels, y_tick_labels):
|
|
301
|
+
if x_tick_labels is not None:
|
|
302
|
+
ax.set_xticklabels(x_tick_labels)
|
|
303
|
+
|
|
304
|
+
if y_tick_labels is not None:
|
|
305
|
+
ax.set_yticklabels(y_tick_labels)
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
def handle_lims(ax, x_lims, y_lims):
|
|
309
|
+
if y_lims is not None:
|
|
310
|
+
ax.set_ylim(y_lims)
|
|
311
|
+
|
|
312
|
+
if x_lims is not None:
|
|
313
|
+
ax.set_xlim(x_lims)
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
def handle_spines(ax, spines):
|
|
317
|
+
if spines is not None:
|
|
318
|
+
tools.set_spine_visibility(ax, spines)
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
def handle_aspect(ax, aspect):
|
|
322
|
+
if aspect is not None:
|
|
323
|
+
aspect = [aspect] if not isinstance(aspect, (list, tuple)) else aspect
|
|
324
|
+
adjustable = None if len(aspect) < 2 else aspect[1]
|
|
325
|
+
aspect_params = {'aspect': aspect[0], 'adjustable': adjustable}
|
|
326
|
+
ax.set_aspect(**aspect_params)
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
def handle_breaks(ax, x_breaks, y_breaks):
|
|
330
|
+
if x_breaks is not None:
|
|
331
|
+
ax.set_xticks(x_breaks)
|
|
332
|
+
|
|
333
|
+
if y_breaks is not None:
|
|
334
|
+
ax.set_yticks(y_breaks)
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
def handle_scales(ax, x_scale, y_scale):
|
|
338
|
+
if y_scale is not None:
|
|
339
|
+
scale_params = tools.parse_scale(scale=y_scale)
|
|
340
|
+
ax.set_yscale(**scale_params)
|
|
341
|
+
|
|
342
|
+
if x_scale is not None:
|
|
343
|
+
scale_params = tools.parse_scale(scale=x_scale)
|
|
344
|
+
ax.set_xscale(**scale_params)
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
def handle_tick_settings(ax, axis, tick_settings):
|
|
348
|
+
# Set default grid style, since rcParams don't offer minor grid style
|
|
349
|
+
if 'grid_linestyle' not in tick_settings:
|
|
350
|
+
tick_settings['grid_linestyle'] = [major_grid_style, minor_grid_style]
|
|
351
|
+
|
|
352
|
+
# if len(tick_settings) == 0:
|
|
353
|
+
# return
|
|
354
|
+
|
|
355
|
+
majmin_settings = {k: utils.maj_min_args(maj_min=v) for k, v in tick_settings.items()}
|
|
356
|
+
|
|
357
|
+
for i, which in enumerate(['major', 'minor']):
|
|
358
|
+
tick_settings_select = {k: v[i] for k, v in majmin_settings.items()}
|
|
359
|
+
ax.tick_params(axis=axis, which=which, **tick_settings_select)
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
def handle_abc_labels(axs, abc=None, **kwargs):
|
|
363
|
+
if abc:
|
|
364
|
+
ax_labels = np.arange(1, len(axs) + 1)
|
|
365
|
+
if abc == 'ABC':
|
|
366
|
+
ax_labels = [chr(64 + num) for num in ax_labels]
|
|
367
|
+
elif abc == 'abc':
|
|
368
|
+
ax_labels = [chr(96 + num) for num in ax_labels]
|
|
369
|
+
|
|
370
|
+
abc_params = utils.get_hook_dict_v2(kwargs, 'abc_', check=True)
|
|
371
|
+
abc_params['loc'] = abc_params['loc'] if 'loc' in abc_params else 'tl'
|
|
372
|
+
abc_params['size'] = abc_params['size'] if 'size' in abc_params else 18
|
|
373
|
+
for i, ax in enumerate(axs):
|
|
374
|
+
decs.place_abc_label(
|
|
375
|
+
ax,
|
|
376
|
+
label=ax_labels[i],
|
|
377
|
+
**abc_params,
|
|
378
|
+
)
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
from matplotlib.colors import ListedColormap, to_rgba
|
|
3
|
+
|
|
4
|
+
allowed_params = {
|
|
5
|
+
'tick_': [
|
|
6
|
+
'size',
|
|
7
|
+
'width',
|
|
8
|
+
'color',
|
|
9
|
+
'pad',
|
|
10
|
+
'direction',
|
|
11
|
+
'labelsize',
|
|
12
|
+
'labelcolor',
|
|
13
|
+
'labelrotation',
|
|
14
|
+
'labelfontfamily',
|
|
15
|
+
'zorder',
|
|
16
|
+
# 'tickdir',
|
|
17
|
+
# 'length',
|
|
18
|
+
],
|
|
19
|
+
'label_': [
|
|
20
|
+
'size',
|
|
21
|
+
'color',
|
|
22
|
+
'pad',
|
|
23
|
+
'rotation',
|
|
24
|
+
'fontfamily',
|
|
25
|
+
'zorder',
|
|
26
|
+
],
|
|
27
|
+
'title_': [
|
|
28
|
+
'size',
|
|
29
|
+
'color',
|
|
30
|
+
'pad',
|
|
31
|
+
'rotation',
|
|
32
|
+
'fontfamily',
|
|
33
|
+
'zorder',
|
|
34
|
+
],
|
|
35
|
+
'abc_': ['style', 'size', 'loc', 'box', 'pad', 'label_pos'],
|
|
36
|
+
'grid_': [
|
|
37
|
+
'color',
|
|
38
|
+
'alpha',
|
|
39
|
+
'linestyle',
|
|
40
|
+
'linewidth',
|
|
41
|
+
'dashes',
|
|
42
|
+
'dash_capstyle',
|
|
43
|
+
'dash_joinstyle',
|
|
44
|
+
'clip_box',
|
|
45
|
+
'clip_on',
|
|
46
|
+
'clip_path',
|
|
47
|
+
'data',
|
|
48
|
+
'drawstyle',
|
|
49
|
+
'figure',
|
|
50
|
+
'fillstyle',
|
|
51
|
+
'gapcolor',
|
|
52
|
+
'gid',
|
|
53
|
+
'in_layout',
|
|
54
|
+
'label',
|
|
55
|
+
'marker',
|
|
56
|
+
'markeredgecolor',
|
|
57
|
+
'markeredgewidth',
|
|
58
|
+
'markerfacecolor',
|
|
59
|
+
'markerfacecoloralt',
|
|
60
|
+
'markersize',
|
|
61
|
+
'markevery',
|
|
62
|
+
'mouseover',
|
|
63
|
+
'path_effects',
|
|
64
|
+
'picker',
|
|
65
|
+
'pickradius',
|
|
66
|
+
'rasterized',
|
|
67
|
+
'sketch_params',
|
|
68
|
+
'snap',
|
|
69
|
+
'solid_capstyle',
|
|
70
|
+
'solid_joinstyle',
|
|
71
|
+
'transform',
|
|
72
|
+
'url',
|
|
73
|
+
'visible',
|
|
74
|
+
'xdata',
|
|
75
|
+
'ydata',
|
|
76
|
+
'zorder',
|
|
77
|
+
'aa',
|
|
78
|
+
'c',
|
|
79
|
+
'ds',
|
|
80
|
+
'ls',
|
|
81
|
+
'lw',
|
|
82
|
+
'mec',
|
|
83
|
+
'mew',
|
|
84
|
+
'mfc',
|
|
85
|
+
'mfcalt',
|
|
86
|
+
'ms',
|
|
87
|
+
'agg_filter',
|
|
88
|
+
'animated',
|
|
89
|
+
'antialiased',
|
|
90
|
+
],
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def get_hook_dict_v2(params, hook, remove_hook: bool = True, check: bool = True) -> dict:
|
|
95
|
+
hook_params = {}
|
|
96
|
+
if params == {}:
|
|
97
|
+
return hook_params
|
|
98
|
+
|
|
99
|
+
for key, value in params.items():
|
|
100
|
+
if not key.startswith(hook):
|
|
101
|
+
continue
|
|
102
|
+
param = key.removeprefix(hook) if remove_hook else key
|
|
103
|
+
|
|
104
|
+
# print(f"recognized '{hook}' parameter: {key}")
|
|
105
|
+
if check:
|
|
106
|
+
if param not in allowed_params.get(hook, []):
|
|
107
|
+
raise ValueError(
|
|
108
|
+
f"Invalid {hook} parameter: '{param}'.\nSupported parameters are: {allowed_params.get(hook, [])}"
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
d = {param: value}
|
|
112
|
+
hook_params.update(d)
|
|
113
|
+
|
|
114
|
+
return hook_params
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def get_hook_dict(params, hook, remove_hook=True) -> dict:
|
|
118
|
+
hook_dict = {}
|
|
119
|
+
|
|
120
|
+
if params == {}:
|
|
121
|
+
return hook_dict
|
|
122
|
+
|
|
123
|
+
for key, value in params.items():
|
|
124
|
+
param = key.split('_')
|
|
125
|
+
if param[0] == hook:
|
|
126
|
+
# print(f"recognized '{hook}' parameter: {key}")
|
|
127
|
+
# if param[1] not in allowed_params.get(hook, []):
|
|
128
|
+
# raise ValueError(
|
|
129
|
+
# f"Invalid {hook} parameter: '{param[1]}'.\nSupported parameters are: {allowed_params.get(hook, [])}"
|
|
130
|
+
# )
|
|
131
|
+
d = {param[1]: value} if remove_hook else {key: value}
|
|
132
|
+
hook_dict.update(d)
|
|
133
|
+
|
|
134
|
+
return hook_dict
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def maj_min_args(maj_min=None):
|
|
138
|
+
if maj_min is None:
|
|
139
|
+
return (None, None)
|
|
140
|
+
if isinstance(maj_min, (list, tuple)) and len(maj_min) == 2:
|
|
141
|
+
return tuple(maj_min)
|
|
142
|
+
return (maj_min, maj_min)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def get_axis_ratio(ax):
|
|
146
|
+
ymin, ymax = ax.get_ylim()
|
|
147
|
+
xmin, xmax = ax.get_xlim()
|
|
148
|
+
y_span, x_span = ymax - ymin, xmax - xmin
|
|
149
|
+
print(round((x_span / y_span), 3))
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def confetti_cmap(n_labels, bg_color: str = None, bg_alpha: float = None, seed: int = None) -> ListedColormap:
|
|
153
|
+
if seed is None:
|
|
154
|
+
seed = 42
|
|
155
|
+
|
|
156
|
+
rng = np.random.default_rng(seed) # fixed seed for reproducibility
|
|
157
|
+
colors = rng.random((n_labels, 3)) # RGB
|
|
158
|
+
colors = np.hstack([colors, np.ones((n_labels, 1))])
|
|
159
|
+
|
|
160
|
+
bg_color = colors[0] if bg_color is None else bg_color
|
|
161
|
+
rgb = to_rgba(bg_color, alpha=bg_alpha)
|
|
162
|
+
colors[0] = np.array(rgb)
|
|
163
|
+
|
|
164
|
+
# Make a discrete colormap
|
|
165
|
+
return ListedColormap(colors)
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
from matplotlib.colors import ListedColormap, to_rgba
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def get_hook_dict(params, hook, remove_hook=True) -> dict:
|
|
6
|
-
hook_dict = {}
|
|
7
|
-
|
|
8
|
-
if params == {}:
|
|
9
|
-
return hook_dict
|
|
10
|
-
|
|
11
|
-
for key, value in params.items():
|
|
12
|
-
param = key.split('_')
|
|
13
|
-
if param[0] == hook:
|
|
14
|
-
d = {param[1]: value} if remove_hook else {key: value}
|
|
15
|
-
hook_dict.update(d)
|
|
16
|
-
|
|
17
|
-
return hook_dict
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def maj_min_args(maj_min=None):
|
|
21
|
-
if maj_min is None:
|
|
22
|
-
return (None, None)
|
|
23
|
-
if isinstance(maj_min, (list, tuple)) and len(maj_min) == 2:
|
|
24
|
-
return tuple(maj_min)
|
|
25
|
-
return (maj_min, maj_min)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def get_axis_ratio(ax):
|
|
29
|
-
ymin, ymax = ax.get_ylim()
|
|
30
|
-
xmin, xmax = ax.get_xlim()
|
|
31
|
-
y_span, x_span = ymax - ymin, xmax - xmin
|
|
32
|
-
print(round((x_span / y_span), 3))
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def confetti_cmap(n_labels, bg_color: str = None, bg_alpha: float = None, seed: int = None) -> ListedColormap:
|
|
36
|
-
if seed is None:
|
|
37
|
-
seed = 42
|
|
38
|
-
|
|
39
|
-
rng = np.random.default_rng(seed) # fixed seed for reproducibility
|
|
40
|
-
colors = rng.random((n_labels, 3)) # RGB
|
|
41
|
-
colors = np.hstack([colors, np.ones((n_labels, 1))])
|
|
42
|
-
|
|
43
|
-
bg_color = colors[0] if bg_color is None else bg_color
|
|
44
|
-
rgb = to_rgba(bg_color, alpha=bg_alpha)
|
|
45
|
-
colors[0] = np.array(rgb)
|
|
46
|
-
|
|
47
|
-
# Make a discrete colormap
|
|
48
|
-
return ListedColormap(colors)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraCode/FiraCode-Bold.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraMath/FiraMath-Bold.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/FiraSans/FiraSans-Bold.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-Black.ttf
RENAMED
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-BlackItalic.ttf
RENAMED
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-Bold.ttf
RENAMED
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-BoldItalic.ttf
RENAMED
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-Italic.ttf
RENAMED
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-Light.ttf
RENAMED
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-LightItalic.ttf
RENAMED
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-Regular.ttf
RENAMED
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-Thin.ttf
RENAMED
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Lato/Lato-ThinItalic.ttf
RENAMED
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/NotoSans/NotoSans-Bold.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/OpenSans/OpenSans-Bold.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Black.ttf
RENAMED
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Bold.ttf
RENAMED
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Italic.ttf
RENAMED
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Light.ttf
RENAMED
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Medium.ttf
RENAMED
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Regular.ttf
RENAMED
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Roboto/Roboto-Thin.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Ubuntu/Ubuntu-Bold.ttf
RENAMED
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Ubuntu/Ubuntu-Italic.ttf
RENAMED
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Ubuntu/Ubuntu-Light.ttf
RENAMED
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Ubuntu/Ubuntu-Medium.ttf
RENAMED
|
File without changes
|
|
File without changes
|
{mpl_spaceplot-0.2.1 → mpl_spaceplot-0.3.0}/src/spaceplot/resources/fonts/Ubuntu/Ubuntu-Regular.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|