Compare commits

..

15 Commits

Author SHA1 Message Date
Moussouni, Yaël
5176a31a9f 2026-03-13: Finished the list of all params 2026-03-13 19:06:36 +01:00
Moussouni, Yaël
b58b2f02a8 2026-03-04: Continued 2026-03-04 18:12:16 +01:00
Moussouni, Yaël
b3bca439b1 2026-02-08: Update 2026-02-08 19:30:42 +01:00
Moussouni, Yaël
663ba89576 2026-02-08: Update 2026-02-08 19:30:05 +01:00
Moussouni, Yaël
502af89000 2026-02-08: Continued machot_plot 2026-02-08 19:21:55 +01:00
Moussouni, Yaël
e5f53bc7e5 2026-02-05: Updated README 2026-02-05 11:07:00 +01:00
Moussouni, Yaël
b89733cafd 2026-02-02: Updated readme 2026-02-02 00:33:44 +01:00
Moussouni, Yaël
475595f0c8 2026-01-30: Changed palette, continued RC params... 2026-01-30 18:40:01 +01:00
Moussouni, Yaël
55e7ba0814 2026-01-30: Updated requirements 2026-01-30 14:52:46 +01:00
Moussouni, Yaël
7178c3de85 2026-01-01: Updated copyright 2026-01-01 00:52:02 +01:00
Moussouni, Yaël
318f93e51d 2025-11-21: Added colours, continued manchot_plot default rc parameters 2025-11-21 20:15:08 +01:00
Moussouni, Yaël
911c925686 2025-11-21: Started manchot_plot default rc parameters 2025-11-21 18:31:45 +01:00
Moussouni, Yaël
80069bb602 2025-11-21: Working structure 2025-11-21 16:12:09 +01:00
Moussouni, Yaël
eaa1c17aeb 2025-11-21: Testing build 2025-11-21 15:39:17 +01:00
Moussouni, Yaël
226580399b 2025-11-21: Re-initialized repo 2025-11-21 14:58:36 +01:00
20 changed files with 1784 additions and 966 deletions

112
.gitignore vendored Normal file
View File

@@ -0,0 +1,112 @@
# Specific files
old/
# Os generated files
## Linux
.Trash-*
## MacOS
.DS_Store
.AppleDouble
.LSOverride
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
._*
## Windows
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
Desktop.ini
desktop.ini
$RECYCLE.BIN/
# temporary or log(s) files and directories
*.tmp
*.log
*.logs
tmp/
log/
logs/
# Python
Build/
build/
venv/
.venv/
__pycache__/
eggs/
.eggs/
wheels/
share/python-wheels/
dist/
*.egg-info/
*.egg
*.pyc
*.pyd
*.pyo
*.pyz
*.so
.installed.cfg
# LaTeX
Build/
build/
*.acn
*.acr
*.alg
*.aux
*.bak
*.bbl
*.bcf
*.blg
*.brf
*.bst
*.dvi
*.fdb_latexmk
*.fls
*.glg
*.glo
*.gls
*.idx
*.ilg
*.ind
*.ist
*.lof
*.log
*.lol
*.lot
*.maf
*.mtc
*.mtc1
*.nav
*.nlo
*.nls
*.out
*.pyg
*.run.xml
*.snm
*.synctex.gz
*.tex.backup
*.tex~
*.thm
*.toc
*.vrb
*.xdy
*.xml
*blx.bib
.bak
.mtc

View File

@@ -1,18 +1,24 @@
# Python Matplotlib Style <!--[TLP:CLEAR] UNLIMITED DISTRIBUTION-->
## [FR] Utilisation ```diff
Le style peut être utilisé avec `plt.style.use("CHEMIN/REPERTOIRE/YII")`. Ce style est prévu pour générer des figures pouvant être intégrées dans un document LaTeX (police Latin Modern Roman) au format A4 avec : [TLP:CLEAR] UNLIMITED DISTRIBUTION
- une colonne et des marges de `3 cm` de chaque côté (`_1`) ```
- deux colonnes avec un séparation de `1 cm` et des marges de `2 cm` de chaque côté (`_2`)
- beamer au format 3:2 (`_beamer`)
- un style plus simple (sans LaTeX) et une police monospace (Latin Modern Mono; `_light`)
plus d'informations: https://matplotlib.org/stable/users/explain/customizing.html#customizing-with-style-sheets # MANCHOT PYthon packaGe to make Matplotlib figures Elegant and Easy (MANCHOT PYGMEE)
## [EN] Usage Author: Moussouni, Yaël (<contact.ial-2@proton.me>)\
The style can be used with `plt.style.use("PATH/DIRECTORY/YII")`. This style has been made to generate figures that can be integrated in LaTeX documents, with: Institution: Université de Strasbourg, CNRS, Observatoire astronomique de Strasbourg, UMR 7550, F-67000 Strasbourg, France\
- one column and `3 cm` margins on each side (`_1`) Date: 2025-02-01
- two columns with a `1 cm` separation and `2 cm` margins (`_2`)
- beamers with a 3:2 format (`_beamer`)
- a more simple style (without LaTeX) and a monospace font (Latin Modern Mono; `_light`)
more informations: https://matplotlib.org/stable/users/explain/customizing.html#customizing-with-style-sheets ## Description
This is work in progress.
## Licence
**MANCHOT-PYGMEE**
Copyright (C) 2026 Yaël Moussouni (<contact.ial-2@proton.me>)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

View File

@@ -1,78 +0,0 @@
### Axes
axes.titlesize : large
axes.labelsize : large
### Lines
lines.linewidth : 1.0
hatch.linewidth: 0.25
lines.markersize: 5
patch.antialiased : True
### Ticks
xtick.top: True
xtick.bottom: True
xtick.major.size: 4.0
xtick.minor.size: 2.0
xtick.major.width: 0.5
xtick.minor.width: 0.5
xtick.direction: in
xtick.minor.visible: True
xtick.major.top: True
xtick.major.bottom: True
xtick.minor.top: True
xtick.minor.bottom: True
xtick.major.pad: 5.0
xtick.minor.pad: 5.0
ytick.labelsize: large
ytick.left: True
ytick.right: True
ytick.major.size: 4.0
ytick.minor.size: 2.0
ytick.major.width: 0.5
ytick.minor.width: 0.5
ytick.direction: in
ytick.minor.visible: True
ytick.major.left: True
ytick.major.right: True
ytick.minor.left: True
ytick.minor.right: True
ytick.major.pad: 5.0
ytick.minor.pad: 5.0
xtick.labelsize: large
### Legend
legend.frameon: True
legend.fontsize: 9.0
### Figure size
figure.figsize: 5.9, 3.9
figure.subplot.left: 0.1
figure.subplot.bottom: 0.175
figure.subplot.top: 0.90
figure.subplot.right: 0.95
figure.autolayout: True
figure.dpi: 150
### Fonts
font.family: serif
font.serif: Latin Modern Roman
font.size: 9.0
text.usetex: true
### Saving figures
savefig.format: pdf
savefig.dpi: 300
savefig.pad_inches: 0
path.simplify: True
### Cycler
axes.prop_cycle: cycler(color=['06518E','E8BD0F','3B795E','ED1C24','C95BCF','009EDB'])
### Colormap
image.cmap: cividis
### LaTeX
text.latex.preamble: \input{~/.config/matplotlib/stylelib/yii_plot.tex}

View File

@@ -1,78 +0,0 @@
### Axes
axes.titlesize : large
axes.labelsize : large
### Lines
lines.linewidth : 1.0
hatch.linewidth: 0.25
lines.markersize: 5
patch.antialiased : True
### Ticks
xtick.top: True
xtick.bottom: True
xtick.major.size: 4.0
xtick.minor.size: 2.0
xtick.major.width: 0.5
xtick.minor.width: 0.5
xtick.direction: in
xtick.minor.visible: True
xtick.major.top: True
xtick.major.bottom: True
xtick.minor.top: True
xtick.minor.bottom: True
xtick.major.pad: 5.0
xtick.minor.pad: 5.0
ytick.labelsize: large
ytick.left: True
ytick.right: True
ytick.major.size: 4.0
ytick.minor.size: 2.0
ytick.major.width: 0.5
ytick.minor.width: 0.5
ytick.direction: in
ytick.minor.visible: True
ytick.major.left: True
ytick.major.right: True
ytick.minor.left: True
ytick.minor.right: True
ytick.major.pad: 5.0
ytick.minor.pad: 5.0
xtick.labelsize: large
### Legend
legend.frameon: True
legend.fontsize: 9.0
### Figure size
figure.figsize: 3.1, 3.9
figure.subplot.left: 0.1
figure.subplot.bottom: 0.175
figure.subplot.top: 0.90
figure.subplot.right: 0.95
figure.autolayout: True
figure.dpi: 150
### Fonts
font.family: serif
font.serif: Latin Modern Roman
font.size: 9.0
text.usetex: true
### Saving figures
savefig.format: pdf
savefig.dpi: 300
savefig.pad_inches: 0
path.simplify: True
### Cycler
axes.prop_cycle: cycler(color=['06518E','E8BD0F','3B795E','ED1C24','C95BCF','009EDB'])
### Colormap
image.cmap: cividis
### LaTeX
text.latex.preamble: \input{~/.config/matplotlib/stylelib/yii_plot.tex}

View File

@@ -1,78 +0,0 @@
### Axes
axes.titlesize : large
axes.labelsize : large
### Lines
lines.linewidth : 1.0
hatch.linewidth: 0.25
lines.markersize: 5
patch.antialiased : True
### Ticks
xtick.top: True
xtick.bottom: True
xtick.major.size: 4.0
xtick.minor.size: 2.0
xtick.major.width: 0.5
xtick.minor.width: 0.5
xtick.direction: in
xtick.minor.visible: True
xtick.major.top: True
xtick.major.bottom: True
xtick.minor.top: True
xtick.minor.bottom: True
xtick.major.pad: 5.0
xtick.minor.pad: 5.0
ytick.labelsize: large
ytick.left: True
ytick.right: True
ytick.major.size: 4.0
ytick.minor.size: 2.0
ytick.major.width: 0.5
ytick.minor.width: 0.5
ytick.direction: in
ytick.minor.visible: True
ytick.major.left: True
ytick.major.right: True
ytick.minor.left: True
ytick.minor.right: True
ytick.major.pad: 5.0
ytick.minor.pad: 5.0
xtick.labelsize: large
### Legend
legend.frameon: True
legend.fontsize: 9.0
### Figure size
figure.figsize: 4.5, 2.05
figure.subplot.left: 0.1
figure.subplot.bottom: 0.175
figure.subplot.top: 0.90
figure.subplot.right: 0.95
figure.autolayout: True
figure.dpi: 150
### Fonts
font.family: serif
font.serif: Latin Modern Roman
font.size: 9.0
text.usetex: true
### Saving figures
savefig.format: pdf
savefig.dpi: 300
savefig.pad_inches: 0
path.simplify: True
### Cycler
axes.prop_cycle: cycler(color=['06518E','E8BD0F','3B795E','ED1C24','C95BCF','009EDB'])
### Colormap
image.cmap: cividis
### LaTeX
text.latex.preamble: \input{~/.config/matplotlib/stylelib/yii_plot.tex}

View File

@@ -1,79 +0,0 @@
### Axes
axes.titlesize : large
axes.labelsize : large
### Lines
lines.linewidth : 1.0
hatch.linewidth: 0.25
lines.markersize: 5
patch.antialiased : True
### Ticks
xtick.top: True
xtick.bottom: True
xtick.major.size: 4.0
xtick.minor.size: 2.0
xtick.major.width: 0.5
xtick.minor.width: 0.5
xtick.direction: in
xtick.minor.visible: True
xtick.major.top: True
xtick.major.bottom: True
xtick.minor.top: True
xtick.minor.bottom: True
xtick.major.pad: 5.0
xtick.minor.pad: 5.0
ytick.labelsize: large
ytick.left: True
ytick.right: True
ytick.major.size: 4.0
ytick.minor.size: 2.0
ytick.major.width: 0.5
ytick.minor.width: 0.5
ytick.direction: in
ytick.minor.visible: True
ytick.major.left: True
ytick.major.right: True
ytick.minor.left: True
ytick.minor.right: True
ytick.major.pad: 5.0
ytick.minor.pad: 5.0
xtick.labelsize: large
### Legend
legend.frameon: True
legend.fontsize: 9.0
### Figure size
figure.figsize: 2.25, 2.05
figure.subplot.left: 0.1
figure.subplot.bottom: 0.175
figure.subplot.top: 0.90
figure.subplot.right: 0.95
figure.autolayout: True
figure.dpi: 150
### Fonts
font.family: serif
font.serif: Latin Modern Roman
font.size: 9.0
text.usetex: true
### Saving figures
savefig.format: pdf
savefig.dpi: 300
savefig.pad_inches: 0
path.simplify: True
### Cycler
axes.prop_cycle: cycler(color=['06518E','E8BD0F','3B795E','ED1C24','C95BCF','009EDB'])
### Colormap
image.cmap: cividis
### LaTeX
text.latex.preamble: \input{~/.config/matplotlib/stylelib/yii_plot.tex}

View File

@@ -1,74 +0,0 @@
### Axes
axes.titlesize : large
axes.labelsize : large
### Lines
lines.linewidth : 1.0
hatch.linewidth: 0.25
lines.markersize: 5
patch.antialiased : True
### Ticks
xtick.top: True
xtick.bottom: True
xtick.major.size: 4.0
xtick.minor.size: 2.0
xtick.major.width: 0.5
xtick.minor.width: 0.5
xtick.direction: in
xtick.minor.visible: False
xtick.major.top: True
xtick.major.bottom: True
xtick.minor.top: False
xtick.minor.bottom: False
xtick.major.pad: 5.0
xtick.minor.pad: 5.0
ytick.labelsize: large
ytick.left: True
ytick.right: True
ytick.major.size: 4.0
ytick.minor.size: 2.0
ytick.major.width: 0.5
ytick.minor.width: 0.5
ytick.direction: in
ytick.minor.visible: False
ytick.major.left: True
ytick.major.right: True
ytick.minor.left: False
ytick.minor.right: False
ytick.major.pad: 5.0
ytick.minor.pad: 5.0
xtick.labelsize: large
### Legend
legend.frameon: True
legend.fontsize: 9.0
### Figure size
figure.figsize: 4.3, 2.3
figure.subplot.left: 0.1
figure.subplot.bottom: 0.175
figure.subplot.top: 0.90
figure.subplot.right: 0.95
figure.autolayout: True
figure.dpi: 150
### Fonts
font.family: monospace
font.serif: Latin Modern Mono
font.size: 9.0
text.usetex: False
### Saving figures
savefig.format: pdf
savefig.dpi: 300
savefig.pad_inches: 0
path.simplify: True
### Cycler
axes.prop_cycle: cycler(color=['06518E','E8BD0F','3B795E','ED1C24','C95BCF','009EDB'])
### Colormap
image.cmap: cividis

View File

@@ -1,74 +0,0 @@
### Axes
axes.titlesize : large
axes.labelsize : large
### Lines
lines.linewidth : 1.0
hatch.linewidth: 0.25
lines.markersize: 5
patch.antialiased : True
### Ticks
xtick.top: True
xtick.bottom: True
xtick.major.size: 4.0
xtick.minor.size: 2.0
xtick.major.width: 0.5
xtick.minor.width: 0.5
xtick.direction: in
xtick.minor.visible: False
xtick.major.top: True
xtick.major.bottom: True
xtick.minor.top: False
xtick.minor.bottom: False
xtick.major.pad: 5.0
xtick.minor.pad: 5.0
ytick.labelsize: large
ytick.left: True
ytick.right: True
ytick.major.size: 4.0
ytick.minor.size: 2.0
ytick.major.width: 0.5
ytick.minor.width: 0.5
ytick.direction: in
ytick.minor.visible: False
ytick.major.left: True
ytick.major.right: True
ytick.minor.left: False
ytick.minor.right: False
ytick.major.pad: 5.0
ytick.minor.pad: 5.0
xtick.labelsize: large
### Legend
legend.frameon: True
legend.fontsize: 9.0
### Figure size
figure.figsize: 2.1, 2.3
figure.subplot.left: 0.1
figure.subplot.bottom: 0.175
figure.subplot.top: 0.90
figure.subplot.right: 0.95
figure.autolayout: True
figure.dpi: 150
### Fonts
font.family: monospace
font.serif: Latin Modern Mono
font.size: 9.0
text.usetex: False
### Saving figures
savefig.format: pdf
savefig.dpi: 300
savefig.pad_inches: 0
path.simplify: True
### Cycler
axes.prop_cycle: cycler(color=['06518E','E8BD0F','3B795E','ED1C24','C95BCF','009EDB'])
### Colormap
image.cmap: cividis

View File

@@ -1,74 +0,0 @@
### Axes
axes.titlesize : large
axes.labelsize : large
### Lines
lines.linewidth : 1.0
hatch.linewidth: 0.25
lines.markersize: 5
patch.antialiased : True
### Ticks
xtick.top: True
xtick.bottom: True
xtick.major.size: 4.0
xtick.minor.size: 2.0
xtick.major.width: 0.5
xtick.minor.width: 0.5
xtick.direction: in
xtick.minor.visible: False
xtick.major.top: True
xtick.major.bottom: True
xtick.minor.top: False
xtick.minor.bottom: False
xtick.major.pad: 5.0
xtick.minor.pad: 5.0
ytick.labelsize: large
ytick.left: True
ytick.right: True
ytick.major.size: 4.0
ytick.minor.size: 2.0
ytick.major.width: 0.5
ytick.minor.width: 0.5
ytick.direction: in
ytick.minor.visible: False
ytick.major.left: True
ytick.major.right: True
ytick.minor.left: False
ytick.minor.right: False
ytick.major.pad: 5.0
ytick.minor.pad: 5.0
xtick.labelsize: large
### Legend
legend.frameon: True
legend.fontsize: 9.0
### Figure size
figure.figsize: 5.9, 3.9
figure.subplot.left: 0.1
figure.subplot.bottom: 0.175
figure.subplot.top: 0.90
figure.subplot.right: 0.95
figure.autolayout: True
figure.dpi: 150
### Fonts
font.family: monospace
font.serif: Latin Modern Mono
font.size: 9.0
text.usetex: False
### Saving figures
savefig.format: pdf
savefig.dpi: 300
savefig.pad_inches: 0
path.simplify: True
### Cycler
axes.prop_cycle: cycler(color=['06518E','E8BD0F','3B795E','ED1C24','C95BCF','009EDB'])
### Colormap
image.cmap: cividis

View File

@@ -1,74 +0,0 @@
### Axes
axes.titlesize : large
axes.labelsize : large
### Lines
lines.linewidth : 1.0
hatch.linewidth: 0.25
lines.markersize: 5
patch.antialiased : True
### Ticks
xtick.top: True
xtick.bottom: True
xtick.major.size: 4.0
xtick.minor.size: 2.0
xtick.major.width: 0.5
xtick.minor.width: 0.5
xtick.direction: in
xtick.minor.visible: False
xtick.major.top: True
xtick.major.bottom: True
xtick.minor.top: False
xtick.minor.bottom: False
xtick.major.pad: 5.0
xtick.minor.pad: 5.0
ytick.labelsize: large
ytick.left: True
ytick.right: True
ytick.major.size: 4.0
ytick.minor.size: 2.0
ytick.major.width: 0.5
ytick.minor.width: 0.5
ytick.direction: in
ytick.minor.visible: False
ytick.major.left: True
ytick.major.right: True
ytick.minor.left: False
ytick.minor.right: False
ytick.major.pad: 5.0
ytick.minor.pad: 5.0
xtick.labelsize: large
### Legend
legend.frameon: True
legend.fontsize: 9.0
### Figure size
figure.figsize: 3.1, 3.9
figure.subplot.left: 0.1
figure.subplot.bottom: 0.175
figure.subplot.top: 0.90
figure.subplot.right: 0.95
figure.autolayout: True
figure.dpi: 150
### Fonts
font.family: monospace
font.serif: Latin Modern Mono
font.size: 9.0
text.usetex: False
### Saving figures
savefig.format: pdf
savefig.dpi: 300
savefig.pad_inches: 0
path.simplify: True
### Cycler
axes.prop_cycle: cycler(color=['06518E','E8BD0F','3B795E','ED1C24','C95BCF','009EDB'])
### Colormap
image.cmap: cividis

28
activate.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# [TLP:AMBER] LIMITED DISTRIBUTION: WORK IN PROGRESS
# Author: Moussouni, Yaël (MSc student; yael.moussouni@etu.unistra.fr)
# Institution: Université de Strasbourg, CNRS, Observatoire astronomique
# de Strasbourg, UMR 7550, F-67000 Strasbourg, France
# Date: 2025-02-10
#
# Licence:
# MSc2 Internship: SMACS Cluster
# Copyright (C) 2026 Yaël Moussouni (yael.moussouni@etu.unistra.fr)
#
# activate.sh
# Copyright (C) 2026 Yaël Moussouni (yael.moussouni@etu.unistra.fr)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see www.gnu.org/licenses/.
source venv/bin/activate

55
pyproject.toml Normal file
View File

@@ -0,0 +1,55 @@
# [TLP:WHITE] FROM 2025-11-21
#
# Author: Moussouni, Yaël (PhD student; yael.moussouni@astro.unistra.fr)
# Institution: Université de Strasbourg, CNRS, Observatoire astronomique
# de Strasbourg, UMR 7550, F-67000 Strasbourg, France
# Date: 2025-11-21
#
# Licence:
# Python Matplotlib Style
# Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
#
# pyproject.toml
# Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see https://www.gnu.org/licenses/.
[project]
name = "manchot_plot"
version = "0.0.1"
authors = [
{ name="Moussouni, Yaël", email="yael.moussouni@astro.unistra.fr" },
]
description = "Python Matplotlib Style"
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
dynamic = ["dependencies"]
license = "GPL-3.0-or-later"
license-files = ["COPYING.txt"]
[project.urls]
Homepage = "https://codeberg.org/Yael-II/Matplotlib-Style/"
Issues = "https://codeberg.org/Yael-II/Matplotlib-Style/issues/"
[build-system]
requires = ["setuptools>=80.9.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

15
requirements.txt Normal file
View File

@@ -0,0 +1,15 @@
cmcrameri==1.9
contourpy==1.3.3
cycler==0.12.1
fonttools==4.60.1
kiwisolver==1.4.9
matplotlib==3.10.7
numpy==2.3.5
packaging==25.0
pillow==12.0.0
pyparsing==3.2.5
PyQt6==6.10.2
PyQt6-Qt6==6.10.2
PyQt6_sip==13.11.0
python-dateutil==2.9.0.post0
six==1.17.0

View File

@@ -0,0 +1,33 @@
#!/usr/bin/env python
#[TLP:AMBER] LIMITED DISTRIBUTION: WORK IN PROGRESS
"""
__init__.py
@ Author: Moussouni, Yaël (PhD student; yael.moussouni@astro.unistra.fr)
@ Institution: Université de Strasbourg, CNRS, Observatoire astronomique
de Strasbourg, UMR 7550, F-67000 Strasbourg, France
@ Date: 2025-11-21
Licence:
Python Matplotlib Style
Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
__init__.py
Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see www.gnu.org/licenses/.
"""
from .manchot_plot import *
from .colours import *

View File

@@ -0,0 +1,59 @@
#!/usr/bin/env python
#[TLP:AMBER] LIMITED DISTRIBUTION: WORK IN PROGRESS
"""
manchot_plot.py
@ Author: Moussouni, Yaël (PhD student; yael.moussouni@astro.unistra.fr)
@ Institution: Université de Strasbourg, CNRS, Observatoire astronomique
de Strasbourg, UMR 7550, F-67000 Strasbourg, France
@ Date: 2025-11-21
Licence:
Python Matplotlib Style
Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
manchot_plot.py
Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see www.gnu.org/licenses/.
"""
# RAL colours (<https://www.ral-farben.de/alle-ral-farben>)
ral_1003 = "#e6b019"
ral_2010 = "#bc602d"
ral_3001 = "#8f1e24"
ral_4008 = "#7c477d"
ral_5005 = "#134a85"
ral_6032 = "#417e57"
ral_7004 = "#969799"
ral_8002 = "#704f40"
ral_9003 = "#ebecea"
ral_9004 = "#2f3133"
ral_350_50_45 = "#a6507e"
# Signal palette
signal_yellow = ral_1003
signal_orange = ral_2010
signal_red = ral_3001
signal_violet = ral_4008
signal_blue = ral_5005
signal_green = ral_6032
signal_grey = ral_7004
signal_brown = ral_8002
signal_white = ral_9003
signal_black = ral_9004
signal_pink = ral_350_50_45

View File

@@ -0,0 +1,728 @@
#!/usr/bin/env python
#[TLP:CLEAR] UNLIMITED DISTRIBUTION
"""
manchot_plot.py
@ Author: Moussouni, Yaël (PhD student; yael.moussouni@astro.unistra.fr)
@ Institution: Université de Strasbourg, CNRS, Observatoire astronomique
de Strasbourg, UMR 7550, F-67000 Strasbourg, France
@ Date: 2025-11-21
Licence:
Python Matplotlib Style
Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
manchot_plot.py
Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see www.gnu.org/licenses/.
"""
import os
import matplotlib as mpl
import numpy as np
import colours as c
import matplotlib.pyplot as plt
from cycler import cycler
cm = 0.3937 # in/cm
class ManchotRC:
def __init__(self):
self.context = {}
# Paper
self.paper = (21*cm, 29.7*cm)
self.margin_left = 3*cm
self.margin_right = 3*cm
self.margin_cols = 0*cm
self.n_cols = 1
self.aspect = 3/2
self.page_linewidth = (self.paper[0] - self.margin_left - self.margin_right)
self.page_textwidth = self.page_linewidth/self.n_cols - self.margin_cols*(self.n_cols - 1)
# Global parameters
self.linewidth = 2
self.markersize = 3
self.pad = 3.5
self.joinstyle = "round"
self.fig_x = self.page_textwidth
self.fig_y = self.fig_x / self.aspect
# Colours
self.colour_fg = "#000000"
self.colour_bg = "#FFFFFF"
self.colours = [c.signal_blue,
c.signal_orange,
c.signal_green,
c.signal_red,
c.signal_violet,
c.signal_brown,
c.signal_pink,
c.signal_grey]
self.colour_fg_rgb = np.array(mpl.colors.to_rgb(self.colour_fg))
self.colour_bg_rgb = np.array(mpl.colors.to_rgb(self.colour_bg))
self.colour_mg_rgb = np.mean([self.colour_fg_rgb, self.colour_bg_rgb],
axis=0)
self.colour_mg = mpl.colors.to_hex(self.colour_mg_rgb)
self.colour_mbg_rgb = np.mean([self.colour_mg_rgb, self.colour_bg_rgb],
axis=0)
self.colour_mbg = mpl.colors.to_hex(self.colour_mbg_rgb)
self.colour_mfg_rgb = np.mean([self.colour_mg_rgb, self.colour_fg_rgb],
axis=0)
self.colour_mfg = mpl.colors.to_hex(self.colour_mfg_rgb)
# Lines
self.lines_linewidth = self.linewidth
self.lines_markersize = self.markersize
self.lines_linestyle = "-"
self.lines_marker = ""
self.lines_markeredgewidth = self.linewidth/2
self.lines_dash_joinstyle = self.joinstyle
self.lines_dash_capstyle = self.joinstyle
self.lines_solid_joinstyle = self.joinstyle
self.lines_solid_capstyle = self.joinstyle
self.lines_color = self.colours[0]
self.lines_markerfacecolor = "auto"
self.lines_markeredgecolor = self.lines_markerfacecolor
# Patches
self.patch_linewidth = self.linewidth
self.patch_force_edgecolor = False
self.patch_facecolor = self.colours[0]
self.patch_edgecolor = self.colour_fg
# Hatches
self.hatch_linewidth = self.linewidth/2
self.hatch_color = self.colour_fg
# Boxplots
self.boxplot_notch = False
self.boxplot_vertical = True
self.boxplot_whiskers = 1.5
self.boxplot_bootstrap = None
self.boxplot_patchartist = False
self.boxplot_showmeans = True
self.boxplot_showcaps = True
self.boxplot_showbox = True
self.boxplot_showfliers = True
self.boxplot_meanline = True
self.boxplot_flierprops_marker = "x"
self.boxplot_flierprops_markeredgewidth = self.linewidth/2
self.boxplot_flierprops_markersize = self.markersize
self.boxplot_flierprops_linestyle = ""
self.boxplot_flierprops_linewidth = self.linewidth
self.boxplot_boxprops_linewidth = self.linewidth
self.boxplot_boxprops_linestyle = "-"
self.boxplot_whiskerprops_linewidth = self.boxplot_boxprops_linewidth
self.boxplot_whiskerprops_linestyle = self.boxplot_boxprops_linestyle
self.boxplot_capprops_linewidth = self.boxplot_boxprops_linewidth
self.boxplot_capprops_linestyle = self.boxplot_boxprops_linestyle
self.boxplot_medianprops_linewidth = self.boxplot_boxprops_linewidth
self.boxplot_medianprops_linestyle = self.boxplot_boxprops_linestyle
self.boxplot_meanprops_marker = "+"
self.boxplot_meanprops_markersize = self.markersize
self.boxplot_meanprops_linestyle = self.boxplot_boxprops_linestyle
self.boxplot_meanprops_linewidth = self.boxplot_boxprops_linewidth
self.boxplot_flierprops_color = self.colour_mg
self.boxplot_flierprops_markerfacecolor = self.colour_fg
self.boxplot_flierprops_markeredgecolor = self.colour_fg
self.boxplot_boxprops_color = self.colour_fg
self.boxplot_whiskerprops_color = self.boxplot_boxprops_color
self.boxplot_capprops_color = self.boxplot_boxprops_color
self.boxplot_medianprops_color = self.colours[1]
self.boxplot_meanprops_color = self.colours[2]
self.boxplot_meanprops_markerfacecolor = self.boxplot_meanprops_color
self.boxplot_meanprops_markeredgecolor = self.boxplot_meanprops_color
# Font
font_list = mpl.font_manager.get_font_names()
if "Latin Modern Roman" in font_list :
self.font_family = "Latin Modern Roman"
elif "Computer Modern Roman" in font_list:
self.font_family = "Computer Modern Roman"
elif "Times" in font_list:
self.font_family = "Computer Modern Roman"
else:
self.font_family = "serif"
self.font_style = "normal"
self.font_variant = "normal"
self.font_weight = "normal"
self.font_stretch = "normal"
self.font_size = 10
self.font_serif = ["Computer Modern Roman",
"Latin Modern Roman",
"Times",
"serif"]
self.font_sans_serif = ["Computer Modern Sans Serif",
"Latin Modern Sans",
"Helvetica",
"Arial",
"sans-serif"]
self.font_monospace = ["Computer Modern Typewriter",
"Latin Modern Mono",
"Courier",
"monospace"]
# Text / LaTeX
self.text_usetex = False
self.latex_preamble = ""
self.mathtext_fontset = "cm"
self.text_color = self.colour_fg
# Axes
self.axes_linewidth = self.linewidth/2
self.axes_grid = True
self.axes_grid_axis = "both"
self.axes_grid_which = "major"
self.axes_titlelocation = "center"
self.axes_titley = None
self.axes_titlesize = "medium"
self.axes_titleweight = "normal"
self.axes_titlepad = self.pad
self.axes_labelsize = "medium"
self.axes_labelweight = "normal"
self.axes_labelpad = self.pad
self.axes_axisbelow = True
self.axes_facecolor = self.colour_bg
self.axes_edgecolor = self.colour_fg
self.axes_titlecolor = self.axes_edgecolor
self.axes_labelcolor = self.axes_edgecolor
self.axes_prop_cycle = cycler(color=self.colours)
self.axes_formatter_limits = (-5, 6)
self.axes_formatter_use_locale = False
self.axes_formatter_use_mathtext = False
self.axes_formatter_min_exponent = 0
self.axes_formatter_useoffset = True
self.axes_formatter_offset_threshold = 4
self.axes_spines_left = True
self.axes_spines_bottom = True
self.axes_spines_top = True
self.axes_spines_right = True
self.axes_unicode_minus = True
self.axes_xmargin = 0.05
self.axes_ymargin = 0.05
self.axes_zmargin = 0.05
self.axes_autolimit_mode = "data"
self.polaraxes_grid = True
self.axes3d_grid = True
self.axes3d_automargin = False
self.axes3d_xaxis_panecolor = np.concatenate([self.colour_mg_rgb, [0.05]])
self.axes3d_yaxis_panecolor = np.concatenate([self.colour_mg_rgb, [0.10]])
self.axes3d_zaxis_panecolor = np.concatenate([self.colour_mg_rgb, [0.15]])
self.axes3d_mouserotationstyle = "trackball"
self.axes3d_trackballsize = 0.667
self.axes3d_trackballborder = 0.2
# Axis
self.xaxis_labellocation = "center"
self.yaxis_labellocation = "center"
# Dates
self.date_autoformatter_year = "%Y"
self.date_autoformatter_month = "%Y-%m"
self.date_autoformatter_day = "%Y-%m-%d"
self.date_autoformatter_hour = "%m-%d%H"
self.date_autoformatter_minute = "%d%H:%M"
self.date_autoformatter_second = "%H:%M:%S"
self.date_autoformatter_microsecond = "%M:%S.%f"
self.date_converter = "auto"
self.date_interval_multiples = True
# Ticks
self.xtick_top = True
self.xtick_bottom = True
self.xtick_labeltop = False
self.xtick_labelbottom = True
self.xtick_major_size = self.linewidth*2
self.xtick_minor_size = self.xtick_major_size/2
self.xtick_major_width = self.linewidth/2
self.xtick_minor_width = self.xtick_major_width
self.xtick_major_pad = self.pad
self.xtick_minor_pad = self.pad
self.xtick_color = self.colour_fg
self.xtick_labelcolor = self.xtick_color
self.xtick_labelsize = "medium"
self.xtick_direction = "in"
self.xtick_minor_visible = False
self.xtick_major_top = True
self.xtick_major_bottom = True
self.xtick_minor_top = True
self.xtick_minor_bottom = True
self.xtick_minor_ndivs = "auto"
self.xtick_alignment = "center"
self.ytick_left = self.xtick_bottom
self.ytick_right = self.xtick_top
self.ytick_labelleft = self.xtick_labelbottom
self.ytick_labelright = self.xtick_labeltop
self.ytick_major_size = self.xtick_major_size
self.ytick_minor_size = self.xtick_minor_size
self.ytick_major_width = self.xtick_major_width
self.ytick_minor_width = self.xtick_minor_width
self.ytick_major_pad = self.xtick_major_pad
self.ytick_minor_pad = self.xtick_minor_pad
self.ytick_color = self.xtick_color
self.ytick_labelcolor = self.xtick_labelcolor
self.ytick_labelsize = self.xtick_labelsize
self.ytick_direction = self.xtick_direction
self.ytick_minor_visible = self.xtick_minor_visible
self.ytick_major_left = self.xtick_major_bottom
self.ytick_major_right = self.xtick_major_top
self.ytick_minor_left = self.xtick_minor_bottom
self.ytick_minor_right = self.xtick_minor_top
self.ytick_minor_ndivs = self.xtick_minor_ndivs
self.ytick_alignment = "center_baseline"
# Grids
self.grid_color = self.colour_mbg
self.grid_linestyle = ":"
self.grid_linewidth = self.linewidth/2
self.grid_alpha = 1
# Legend
self.legend_loc = "best"
self.legend_frameon = True
self.legend_framealpha = 0.8
self.legend_facecolor = self.colour_bg
self.legend_edgecolor = self.colour_mbg
self.legend_fancybox = True
self.legend_shadow = False
self.legend_numpoints = 1
self.legend_scatterpoints = 1
self.legend_markerscale = 1.0
self.legend_fontsize = "medium"
self.legend_labelcolor = self.colour_fg
self.legend_title_fontsize = None
self.legend_borderpad = 0.4
self.legend_labelspacing = 0.5
self.legend_handlelength = 2.0
self.legend_handleheight = 0.7
self.legend_handletextpad = 0.8
self.legend_borderaxespad = 0.5
self.legend_columnspacing = 2.0
# Figure
self.figure_titlesize = "medium"
self.figure_titleweight = "normal"
self.figure_labelsize = "medium"
self.figure_labelweight = "normal"
self.figure_figsize = self.fig_x, self.fig_y
self.figure_dpi = 150
self.figure_facecolor = self.colour_bg
self.figure_edgecolor = self.colour_bg
self.figure_frameon = True
self.figure_subplot_left = 0.125
self.figure_subplot_right = 0.9
self.figure_subplot_bottom = 0.11
self.figure_subplot_top = 0.88
self.figure_subplot_wspace = 0.2
self.figure_subplot_hspace = 0.2
self.figure_autolayout = False
self.figure_constrained_layout_use = True
self.figure_constrained_layout_h_pad = 0.04
self.figure_constrained_layout_w_pad = 0.04
self.figure_constrained_layout_hspace = 0.02
self.figure_constrained_layout_wspace = 0.02
# Images
self.image_aspect = "equal"
self.image_interpolation = "auto"
self.image_interpolation_stage = "auto"
self.image_cmap = "viridis"
self.image_lut = 256
self.image_origin = "upper"
self.image_resample = True
self.image_composite_image = True
# Contour, error bar, histogram and scatter
self.contour_negative_linestyle = "dashed"
self.contour_corner_mask = True
self.contour_linewidth = self.linewidth
self.contour_algorithm = "mpl2014"
self.errorbar_capsize = self.markersize
self.hist_bins = 10
self.scatter_marker = "o"
self.scatter_edgecolors = "face"
# Savefig
self.savefig_dpi = 300
self.savefig_facecolor = "auto"
self.savefig_edgecolor = "auto"
self.savefig_format = "pdf"
self.savefig_bbox = "standard"
self.savefig_pad_inches = 0
self.savefig_transparent = True
# Compute
self._compute()
return None
def _compute(self):
self.context = {}
# Paper
margin = self.margin_left + self.margin_right \
+ (self.n_cols - 1) * self.margin_cols
figsize_x = self.paper[0]/self.n_cols - margin
figsize_y = figsize_x / self.aspect
# Lines
self.context["lines.linewidth"] = self.lines_linewidth
self.context["lines.linestyle"] = self.lines_linestyle
self.context["lines.color"] = self.lines_color
self.context["lines.marker"] = self.lines_marker
self.context["lines.markerfacecolor"] = self.lines_markerfacecolor
self.context["lines.markeredgecolor"] = self.lines_markeredgecolor
self.context["lines.markeredgewidth"] = self.lines_markeredgewidth
self.context["lines.markersize"] = self.lines_markersize
self.context["lines.dash_joinstyle"] = self.lines_dash_joinstyle
self.context["lines.dash_capstyle"] = self.lines_dash_capstyle
self.context["lines.solid_joinstyle"] = self.lines_solid_joinstyle
self.context["lines.solid_capstyle"] = self.lines_solid_capstyle
# Patches
self.context["patch.linewidth"] = self.patch_linewidth
self.context["patch.facecolor"] = self.patch_facecolor
self.context["patch.edgecolor"] = self.patch_edgecolor
self.context["patch.force_edgecolor"] = self.patch_force_edgecolor
# Boxplot
self.context["boxplot.notch"] = self.boxplot_notch
self.context["boxplot.vertical"] = self.boxplot_vertical
self.context["boxplot.whiskers"] = self.boxplot_whiskers
self.context["boxplot.bootstrap"] = self.boxplot_bootstrap
self.context["boxplot.patchartist"] = self.boxplot_patchartist
self.context["boxplot.showmeans"] = self.boxplot_showmeans
self.context["boxplot.showcaps"] = self.boxplot_showcaps
self.context["boxplot.showbox"] = self.boxplot_showbox
self.context["boxplot.showfliers"] = self.boxplot_showfliers
self.context["boxplot.meanline"] = self.boxplot_meanline
self.context["boxplot.flierprops.color"] = self.boxplot_flierprops_color
self.context["boxplot.flierprops.marker"] = self.boxplot_flierprops_marker
self.context["boxplot.flierprops.markerfacecolor"] = self.boxplot_flierprops_markerfacecolor
self.context["boxplot.flierprops.markeredgecolor"] = self.boxplot_flierprops_markeredgecolor
self.context["boxplot.flierprops.markeredgewidth"] = self.boxplot_flierprops_markeredgewidth
self.context["boxplot.flierprops.markersize"] = self.boxplot_flierprops_markersize
self.context["boxplot.flierprops.linestyle"] = self.boxplot_flierprops_linestyle
self.context["boxplot.flierprops.linewidth"] = self.boxplot_flierprops_linewidth
self.context["boxplot.boxprops.color"] = self.boxplot_boxprops_color
self.context["boxplot.boxprops.linewidth"] = self.boxplot_boxprops_linewidth
self.context["boxplot.boxprops.linestyle"] = self.boxplot_boxprops_linestyle
self.context["boxplot.whiskerprops.color"] = self.boxplot_whiskerprops_color
self.context["boxplot.whiskerprops.linewidth"] = self.boxplot_whiskerprops_linewidth
self.context["boxplot.whiskerprops.linestyle"] = self.boxplot_whiskerprops_linestyle
self.context["boxplot.capprops.color"] = self.boxplot_capprops_color
self.context["boxplot.capprops.linewidth"] = self.boxplot_capprops_linewidth
self.context["boxplot.capprops.linestyle"] = self.boxplot_capprops_linestyle
self.context["boxplot.medianprops.color"] = self.boxplot_medianprops_color
self.context["boxplot.medianprops.linewidth"] = self.boxplot_medianprops_linewidth
self.context["boxplot.medianprops.linestyle"] = self.boxplot_medianprops_linestyle
self.context["boxplot.meanprops.color"] = self.boxplot_meanprops_color
self.context["boxplot.meanprops.marker"] = self.boxplot_meanprops_marker
self.context["boxplot.meanprops.markerfacecolor"] = self.boxplot_meanprops_markerfacecolor
self.context["boxplot.meanprops.markeredgecolor"] = self.boxplot_meanprops_markeredgecolor
self.context["boxplot.meanprops.linestyle"] = self.boxplot_meanprops_linestyle
self.context["boxplot.meanprops.linewidth"] = self.boxplot_meanprops_linewidth
# Font
self.context["font.family"] = self.font_family
self.context["font.style"] = self.font_style
self.context["font.variant"] = self.font_variant
self.context["font.weight"] = self.font_weight
self.context["font.stretch"] = self.font_stretch
self.context["font.size"] = self.font_size
self.context["font.serif"] = self.font_serif
self.context["font.sans-serif"] = self.font_sans_serif
self.context["font.monospace"] = self.font_monospace
# Text / LaTeX
self.context["text.usetex"] = self.text_usetex
self.context["text.latex.preamble"] = self.latex_preamble
self.context["mathtext.fontset"] = self.mathtext_fontset
# Axes
self.context["axes.facecolor"] = self.axes_facecolor
self.context["axes.edgecolor"] = self.axes_edgecolor
self.context["axes.linewidth"] = self.axes_linewidth
self.context["axes.grid"] = self.axes_grid
self.context["axes.grid.axis"] = self.axes_grid_axis
self.context["axes.grid.which"] = self.axes_grid_which
self.context["axes.titlelocation"] = self.axes_titlelocation
self.context["axes.titlesize"] = self.axes_titlesize
self.context["axes.titleweight"] = self.axes_titleweight
self.context["axes.titlecolor"] = self.axes_titlecolor
self.context["axes.titley"] = self.axes_titley
self.context["axes.titlepad"] = self.axes_titlepad
self.context["axes.labelsize"] = self.axes_labelsize
self.context["axes.labelpad"] = self.axes_labelpad
self.context["axes.labelweight"] = self.axes_labelweight
self.context["axes.labelcolor"] = self.axes_labelcolor
self.context["axes.axisbelow"] = self.axes_axisbelow
self.context["axes.prop_cycle"] = self.axes_prop_cycle
# Axes
self.context["axes.formatter.limits"] = self.axes_formatter_limits
self.context["axes.formatter.use_locale"] = self.axes_formatter_use_locale
self.context["axes.formatter.use_mathtext"] = self.axes_formatter_use_mathtext
self.context["axes.formatter.min_exponent"] = self.axes_formatter_min_exponent
self.context["axes.formatter.useoffset"] = self.axes_formatter_useoffset
self.context["axes.formatter.offset_threshold"] = self.axes_formatter_offset_threshold
self.context["axes.spines.left"] = self.axes_spines_left
self.context["axes.spines.bottom"] = self.axes_spines_bottom
self.context["axes.spines.top"] = self.axes_spines_top
self.context["axes.spines.right"] = self.axes_spines_right
self.context["axes.unicode_minus"] = self.axes_unicode_minus
self.context["axes.xmargin"] = self.axes_xmargin
self.context["axes.ymargin"] = self.axes_ymargin
self.context["axes.zmargin"] = self.axes_zmargin
self.context["axes.autolimit_mode"] = self.axes_autolimit_mode
self.context["polaraxes.grid"] = self.polaraxes_grid
self.context["axes3d.grid"] = self.axes3d_grid
self.context["axes3d.automargin"] = self.axes3d_automargin
self.context["axes3d.xaxis.panecolor"] = self.axes3d_xaxis_panecolor
self.context["axes3d.yaxis.panecolor"] = self.axes3d_yaxis_panecolor
self.context["axes3d.zaxis.panecolor"] = self.axes3d_zaxis_panecolor
self.context["axes3d.mouserotationstyle"] = self.axes3d_mouserotationstyle
self.context["axes3d.trackballsize"] = self.axes3d_trackballsize
self.context["axes3d.trackballborder"] = self.axes3d_trackballborder
# Axis
self.context["xaxis.labellocation"] = self.xaxis_labellocation
self.context["yaxis.labellocation"] = self.yaxis_labellocation
# Dates
self.context["date.autoformatter.year"] = self.date_autoformatter_year
self.context["date.autoformatter.month"] = self.date_autoformatter_month
self.context["date.autoformatter.day"] = self.date_autoformatter_day
self.context["date.autoformatter.hour"] = self.date_autoformatter_hour
self.context["date.autoformatter.minute"] = self.date_autoformatter_minute
self.context["date.autoformatter.second"] = self.date_autoformatter_second
self.context["date.autoformatter.microsecond"] = self.date_autoformatter_microsecond
self.context["date.converter"] = self.date_converter
self.context["date.interval_multiples"] = self.date_interval_multiples
# Ticks
self.context["xtick.top"] = self.xtick_top
self.context["xtick.bottom"] = self.xtick_bottom
self.context["xtick.labeltop"] = self.xtick_labeltop
self.context["xtick.labelbottom"] = self.xtick_labelbottom
self.context["xtick.major.size"] = self.xtick_major_size
self.context["xtick.minor.size"] = self.xtick_minor_size
self.context["xtick.major.width"] = self.xtick_major_width
self.context["xtick.minor.width"] = self.xtick_minor_width
self.context["xtick.major.pad"] = self.xtick_major_pad
self.context["xtick.minor.pad"] = self.xtick_minor_pad
self.context["xtick.color"] = self.xtick_color
self.context["xtick.labelcolor"] = self.xtick_labelcolor
self.context["xtick.labelsize"] = self.xtick_labelsize
self.context["xtick.direction"] = self.xtick_direction
self.context["xtick.minor.visible"] = self.xtick_minor_visible
self.context["xtick.major.top"] = self.xtick_major_top
self.context["xtick.major.bottom"] = self.xtick_major_bottom
self.context["xtick.minor.top"] = self.xtick_minor_top
self.context["xtick.minor.bottom"] = self.xtick_minor_bottom
self.context["xtick.minor.ndivs"] = self.xtick_minor_ndivs
self.context["xtick.alignment"] = self.xtick_alignment
self.context["ytick.left"] = self.ytick_left
self.context["ytick.right"] = self.ytick_right
self.context["ytick.labelleft"] = self.ytick_labelleft
self.context["ytick.labelright"] = self.ytick_labelright
self.context["ytick.major.size"] = self.ytick_major_size
self.context["ytick.minor.size"] = self.ytick_minor_size
self.context["ytick.major.width"] = self.ytick_major_width
self.context["ytick.minor.width"] = self.ytick_minor_width
self.context["ytick.major.pad"] = self.ytick_major_pad
self.context["ytick.minor.pad"] = self.ytick_minor_pad
self.context["ytick.color"] = self.ytick_color
self.context["ytick.labelcolor"] = self.ytick_labelcolor
self.context["ytick.labelsize"] = self.ytick_labelsize
self.context["ytick.direction"] = self.ytick_direction
self.context["ytick.minor.visible"] = self.ytick_minor_visible
self.context["ytick.major.left"] = self.ytick_major_left
self.context["ytick.major.right"] = self.ytick_major_right
self.context["ytick.minor.left"] = self.ytick_minor_left
self.context["ytick.minor.right"] = self.ytick_minor_right
self.context["ytick.minor.ndivs"] = self.ytick_minor_ndivs
self.context["ytick.alignment"] = self.ytick_alignment
# Grid
self.context["grid.color"] = self.grid_color
self.context["grid.linestyle"] = self.grid_linestyle
self.context["grid.linewidth"] = self.grid_linewidth
self.context["grid.alpha"] = self.grid_alpha
# Legend
self.context["legend.loc"] = self.legend_loc
self.context["legend.frameon"] = self.legend_frameon
self.context["legend.framealpha"] = self.legend_framealpha
self.context["legend.facecolor"] = self.legend_facecolor
self.context["legend.edgecolor"] = self.legend_edgecolor
self.context["legend.fancybox"] = self.legend_fancybox
self.context["legend.shadow"] = self.legend_shadow
self.context["legend.numpoints"] = self.legend_numpoints
self.context["legend.scatterpoints"] = self.legend_scatterpoints
self.context["legend.markerscale"] = self.legend_markerscale
self.context["legend.fontsize"] = self.legend_fontsize
self.context["legend.labelcolor"] = self.legend_labelcolor
self.context["legend.title_fontsize"] = self.legend_title_fontsize
self.context["legend.borderpad"] = self.legend_borderpad
self.context["legend.labelspacing"] = self.legend_labelspacing
self.context["legend.handlelength"] = self.legend_handlelength
self.context["legend.handleheight"] = self.legend_handleheight
self.context["legend.handletextpad"] = self.legend_handletextpad
self.context["legend.borderaxespad"] = self.legend_borderaxespad
self.context["legend.columnspacing"] = self.legend_columnspacing
# Figure
self.context["figure.titlesize"] = self.figure_titlesize
self.context["figure.titleweight"] = self.figure_titleweight
self.context["figure.labelsize"] = self.figure_labelsize
self.context["figure.labelweight"] = self.figure_labelweight
self.context["figure.figsize"] = self.figure_figsize
self.context["figure.dpi"] = self.figure_dpi
self.context["figure.facecolor"] = self.figure_facecolor
self.context["figure.edgecolor"] = self.figure_edgecolor
self.context["figure.frameon"] = self.figure_frameon
self.context["figure.subplot.left"] = self.figure_subplot_left
self.context["figure.subplot.right"] = self.figure_subplot_right
self.context["figure.subplot.bottom"] = self.figure_subplot_bottom
self.context["figure.subplot.top"] = self.figure_subplot_top
self.context["figure.subplot.wspace"] = self.figure_subplot_wspace
self.context["figure.subplot.hspace"] = self.figure_subplot_hspace
self.context["figure.autolayout"] = self.figure_autolayout
self.context["figure.constrained_layout.use"] = self.figure_constrained_layout_use
self.context["figure.constrained_layout.h_pad"] = self.figure_constrained_layout_h_pad
self.context["figure.constrained_layout.w_pad"] = self.figure_constrained_layout_w_pad
self.context["figure.constrained_layout.hspace"] = self.figure_constrained_layout_hspace
self.context["figure.constrained_layout.wspace"] = self.figure_constrained_layout_wspace
# Images
self.context["image.aspect"] = self.image_aspect
self.context["image.interpolation"] = self.image_interpolation
self.context["image.interpolation_stage"] = self.image_interpolation_stage
self.context["image.cmap"] = self.image_cmap
self.context["image.lut"] = self.image_lut
self.context["image.origin"] = self.image_origin
self.context["image.resample"] = self.image_resample
self.context["image.composite_image"] = self.image_composite_image
# Contour, error bar, histogram and scatter
self.context["contour.negative_linestyle"] = self.contour_negative_linestyle
self.context["contour.corner_mask"] = self.contour_corner_mask
self.context["contour.linewidth"] = self.contour_linewidth
self.context["contour.algorithm"] = self.contour_algorithm
self.context["errorbar.capsize"] = self.errorbar_capsize
self.context["hist.bins"] = self.hist_bins
self.context["scatter.marker"] = self.scatter_marker
self.context["scatter.edgecolors"] = self.scatter_edgecolors
# Savefig
self.context["savefig.dpi"] = self.savefig_dpi
self.context["savefig.facecolor"] = self.savefig_facecolor
self.context["savefig.edgecolor"] = self.savefig_edgecolor
self.context["savefig.format"] = self.savefig_format
self.context["savefig.bbox"] = self.savefig_bbox
self.context["savefig.pad_inches"] = self.savefig_pad_inches
self.context["savefig.transparent"] = self.savefig_transparent
return None
from mpl_toolkits.mplot3d import axes3d
if __name__ == "__main__":
rc = ManchotRC()
with plt.style.context(rc.context):
fig, axs = plt.subplots(1, 3)
fig.suptitle("Default plot")
axs[0].plot([0,1,2,3,4], [2,1,4,3,6], label="curve 1")
axs[0].plot([0,1,2,3,4], [4,3,1,2,4], "o--", label="curve 2")
axs[0].set_title("Lorem")
axs[0].set_xlabel("$x~\\mathrm{[cm]}$")
axs[0].set_ylabel("$y~\\mathrm{[cm]}$")
axs[0].legend()
axs[1].scatter([0,1,2,3,4], [2,1,4,3,6])
axs[1].scatter([0,1,2,3,4], [4,3,1,2,4], s=[1,2,3,4,6])
axs[1].set_title("Ipsum")
axs[1].set_xlabel("$x~\\mathrm{[cm]}$")
axs[1].set_ylabel("$y~\\mathrm{[cm]}$")
axs[1].text(2, 2, "sample text")
axs[2].set_title("Dolor")
axs[2].bar([1,2], [3,2])
axs[2].bar([3,4], [3,4], hatch="/")
axs[2].boxplot([[2,4,6,4,6,4,6,5,6,6,7,7,8,7,5],
[1,4,6,5,6,7,5,3,5,6,7],
[2,6,5,6,6,4,5,6,7,5,4,5,2]])
axs[2].set_xlabel("Value")
axs[2].set_ylabel("Number")
fig = plt.figure()
ax = fig.add_subplot(projection="3d")
X, Y, Z = axes3d.get_test_data(0.05)
# Plot the 3D surface
ax.plot_surface(X, Y, Z, edgecolor='C0', lw=0.5, rstride=8, cstride=8,
alpha=0.3)
# Plot projections of the contours for each dimension. By choosing offsets
# that match the appropriate axes limits, the projected contours will sit on
# the 'walls' of the graph.
ax.contour(X, Y, Z, zdir='z', offset=-100)
ax.contour(X, Y, Z, zdir='x', offset=-40)
ax.contour(X, Y, Z, zdir='y', offset=40)
ax.set(xlim=(-40, 40), ylim=(-40, 40), zlim=(-100, 100),
xlabel='X', ylabel='Y', zlabel='Z')
plt.show()

3
tests/test.py Normal file
View File

@@ -0,0 +1,3 @@
import manchot_plot
print(manchot_plot.a)

View File

@@ -1,324 +0,0 @@
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{textgreek}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xparse}
\usepackage{esint}
\usepackage{physics}
\renewcommand{\oiint}{\varoiint} % integral symbol
\DeclareSymbolFont{yiilm}{T1}{lmr}{m}{n}
\DeclareMathSymbol{\Alpha}{7}{yiilm}{"41}
\DeclareMathSymbol{\Beta}{7}{yiilm}{"42}
\DeclareMathSymbol{\Epsilon}{7}{yiilm}{"45}
\DeclareMathSymbol{\Zeta}{7}{yiilm}{"5A}
\DeclareMathSymbol{\Eta}{7}{yiilm}{"48}
\DeclareMathSymbol{\Iota}{7}{yiilm}{"49}
\DeclareMathSymbol{\Kappa}{7}{yiilm}{"4B}
\DeclareMathSymbol{\Mu}{7}{yiilm}{"4D}
\DeclareMathSymbol{\Nu}{7}{yiilm}{"4E}
\DeclareMathSymbol{\Omicron}{7}{yiilm}{"4F}
\DeclareMathSymbol{\Rho}{7}{yiilm}{"50}
\DeclareMathSymbol{\Tau}{7}{yiilm}{"54}
\DeclareMathSymbol{\Chi}{7}{yiilm}{"58}
\let\yiiepsilon\epsilon
\let\epsilon\varepsilon
\let\varepsilon\yiiepsilon
\let\Varepsilon\Epsilon
\let\Vartheta\Theta
\let\Varpi\Pi
\let\Varrho\Rho
\let\Varphi\Phi
\let\textvarepsilon\straightepsilon
\let\textvarrho\textrho
\let\textvarphi\textphi
\let\textphi\straightphi
\let\textvartheta\texttheta
\let\texttheta\straighttheta
\let\textVarepsilon\textEpsilon
\let\textVartheta\textTheta
\let\textVarrho\textRho
\let\textVarphi\textPhi
\newcommand{\omicron}{\mathit{o}}
\renewcommand{\textomicron}{o}
\renewcommand{\textOmicron}{O}
\newcommand{\mathalpha}{\text{\textalpha}}
\newcommand{\mathbeta}{\text{\textbeta}}
\newcommand{\mathgamma}{\text{\textgamma}}
\newcommand{\mathdelta}{\text{\textdelta}}
\newcommand{\mathepsilon}{\text{\textepsilon}}
\newcommand{\mathvarepsilon}{\text{\textvarepsilon}}
\newcommand{\mathzeta}{\text{\textzeta}}
\newcommand{\matheta}{\text{\texteta}}
\newcommand{\maththeta}{\text{\texttheta}}
\newcommand{\mathvartheta}{\text{\textvartheta}}
\newcommand{\mathiota}{\text{\textiota}}
\newcommand{\mathkappa}{\text{\textkappa}}
\newcommand{\mathlambda}{\text{\textlambda}}
\newcommand{\mathmu}{\text{\textmu}}
\newcommand{\mathnu}{\text{\textnu}}
\newcommand{\mathxi}{\text{\textxi}}
\newcommand{\mathomicron}{\text{\textomicron}}
\newcommand{\mathpi}{\text{\textpi}}
\newcommand{\mathrho}{\text{\textrho}}
\newcommand{\mathvarrho}{\text{\textvarrho}}
\newcommand{\mathsigma}{\text{\textsigma}}
\newcommand{\mathtau}{\text{\texttau}}
\newcommand{\mathupsilon}{\text{\textupsilon}}
\newcommand{\mathphi}{\text{\textphi}}
\newcommand{\mathvarphi}{\text{\textvarphi}}
\newcommand{\mathchi}{\text{\textchi}}
\newcommand{\mathpsi}{\text{\textpsi}}
\newcommand{\mathomega}{\text{\textomega}}
\newcommand{\mathAlpha}{\text{\textAlpha}}
\newcommand{\mathBeta}{\text{\textBeta}}
\newcommand{\mathGamma}{\text{\textGamma}}
\newcommand{\mathDelta}{\text{\textDelta}}
\newcommand{\mathEpsilon}{\text{\textEpsilon}}
\newcommand{\mathVarepsilon}{\text{\textVarepsilon}}
\newcommand{\mathZeta}{\text{\textZeta}}
\newcommand{\mathEta}{\text{\textEta}}
\newcommand{\mathTheta}{\text{\textTheta}}
\newcommand{\mathVartheta}{\text{\textVartheta}}
\newcommand{\mathIota}{\text{\textIota}}
\newcommand{\mathKappa}{\text{\textKappa}}
\newcommand{\mathLambda}{\text{\textLambda}}
\newcommand{\mathMu}{\text{\textMu}}
\newcommand{\mathNu}{\text{\textNu}}
\newcommand{\mathXi}{\text{\textXi}}
\newcommand{\mathOmicron}{\text{\textOmicron}}
\newcommand{\mathPi}{\text{\textPi}}
\newcommand{\mathRho}{\text{\textRho}}
\newcommand{\mathVarrho}{\text{\textVarrho}}
\newcommand{\mathSigma}{\text{\textSigma}}
\newcommand{\mathTau}{\text{\textTau}}
\newcommand{\mathUpsilon}{\text{\textUpsilon}}
\newcommand{\mathPhi}{\text{\textPhi}}
\newcommand{\mathVarphi}{\text{\textVarphi}}
\newcommand{\mathChi}{\text{\textChi}}
\newcommand{\mathPsi}{\text{\textPsi}}
\newcommand{\mathOmega}{\text{\textOmega}}
\let\micro\mathmu
% Commands
%% vectors
\let\vect\vb
\let\rot\curl
%% set and spaces
\newcommand{\set}[1]{\mathbf{#1}} % set (in bold)
\newcommand{\spc}[1]{\mathcal{#1}} % space (in cal)
\newcommand{\N}{\set{N}}
\newcommand{\Z}{\set{Z}}
\newcommand{\D}{\set{D}}
\newcommand{\Q}{\set{Q}}
\newcommand{\R}{\set{R}}
\newcommand{\C}{\set{C}}
\newcommand{\K}{\set{K}}
\newcommand{\intqty}[1]{\left[\!\left[{#1}\right]\!\right]}
%% quantities
\newcommand{\lag}{\mathcal{L}}
\newcommand{\ham}{\mathcal{H}}
\newcommand{\mom}{\mathcal{M}}
%% symbols
\newcommand{\odeg}{\text{°}}
\newcommand{\omin}{\text{'}}
\newcommand{\osec}{\text{''}}
\let\transp\top
\let\Sun\odot
\let\Earth\oplus
%% Operators
\DeclareMathOperator{\Sp}{Sp}
\DeclareMathOperator{\Image}{Im}
\DeclareMathOperator{\Ker}{Ker}
\DeclareMathOperator{\arctantwo}{arctan2}
\DeclareMathOperator{\FT}{FT}
\let\lap\laplacian % Physics alias
%% Probability
\DeclareMathOperator{\p}{\mathbb{P}}
\DeclareMathOperator{\pO}{\mathbb{O}}
\DeclareMathOperator{\pF}{\mathbb{F}}
\DeclareMathOperator{\pdf}{\mathbb{F'}}
\DeclareMathOperator{\pE}{\mathbb{E}}
\DeclareMathOperator{\pV}{\mathbb{V}}
\DeclareMathOperator{\normal}{\mathcal{N}}
\DeclareMathOperator{\binomial}{\mathcal{B}}
\DeclareMathOperator{\poisson}{\mathcal{P}}
%% Constants
\newcommand{\im}{\mathrm{i}}
\newcommand{\jm}{\mathrm{j}}
\newcommand{\e}{\mathrm{e}}
\newcommand{\NA}{\mathcal{N}_\mathrm{A}}
\newcommand{\kB}{k_\mathrm{B}}
\newcommand{\muB}{\mu_\mathrm{B}}
\newcommand{\cst}{\mathrm{cst}}
\newcommand{\uma}{\mathrm{u}}
%% Unitary vectors
\newcommand{\ux}{\vu u_x}
\newcommand{\uy}{\vu u_y}
\newcommand{\uz}{\vu u_z}
\newcommand{\ur}{\vu u_r}
\newcommand{\un}{\vu u_n}
\newcommand{\ut}{\vu u_t}
\newcommand{\urho}{\vu u_\rho}
\newcommand{\uvarrho}{\vu u_\varrho}
\newcommand{\utheta}{\vu u_\theta}
\newcommand{\uvartheta}{\vu u_\vartheta}
\newcommand{\uphi}{\vu u_\phi}
\newcommand{\uvarphi}{\vu u_\varphi}
\newcommand{\ex}{\vu e_x}
\newcommand{\ey}{\vu e_y}
\newcommand{\ez}{\vu e_z}
\newcommand{\er}{\vu e_r}
\newcommand{\en}{\vu e_n}
\newcommand{\et}{\vu e_t}
\newcommand{\erho}{\vu e_\rho}
\newcommand{\evarrho}{\vu e_\varrho}
\newcommand{\etheta}{\vu e_\theta}
\newcommand{\evartheta}{\vu e_\vartheta}
\newcommand{\ephi}{\vu e_\phi}
\newcommand{\evarphi}{\vu e_\varphi}
\newcommand{\vux}{\vu x}
\newcommand{\vuy}{\vu y}
\newcommand{\vuz}{\vu z}
\newcommand{\vur}{\vu r}
\newcommand{\vun}{\vu n}
\newcommand{\vut}{\vu t}
\newcommand{\vurho}{\vu{\boldsymbol{\rho}}}
\newcommand{\vuvarrho}{\vu{\boldsymbol{\varrho}}}
\newcommand{\vutheta}{\vu{\boldsymbol{\theta}}}
\newcommand{\vuvartheta}{\vu{\boldsymbol{\vartheta}}}
\newcommand{\vuphi}{\vu{\boldsymbol{\phi}}}
\newcommand{\vuvarphi}{\vu{\boldsymbol{\varphi}}}
%% Differential elements
\newcommand{\ds}{\dd{s}}
\newcommand{\dx}{\dd{x}}
\newcommand{\dy}{\dd{y}}
\newcommand{\dz}{\dd{z}}
\newcommand{\dt}{\dd{t}}
\newcommand{\dr}{\dd{r}}
\newcommand{\drho}{\dd{\rho}}
\newcommand{\dvarrho}{\dd{\varrho}}
\newcommand{\dtheta}{\dd{\theta}}
\newcommand{\dvartheta}{\dd{\vartheta}}
\newcommand{\dphi}{\dd{\phi}}
\newcommand{\dvarphi}{\dd{\varphi}}
\newcommand{\deron}{\partial}
\newcommand{\ddr}{\dd[3]{\vect r}}
\newcommand{\ddp}{\dd[3]{\vect p}}
\newcommand{\ddk}{\dd[3]{\vect k}}
%% Physics complement
\def\diffD{\mathrm{D}}
\DeclareDocumentCommand\Differential{ o g d() }{
\IfNoValueTF{#2}{
\IfNoValueTF{#3}{
\diffD\IfNoValueTF{#1}{}{^{#1}}
}{
\mathinner{\diffD\IfNoValueTF{#1}{}{^{#1}}\argopen(#3\argclose)}}
}{
\mathinner{\diffD\IfNoValueTF{#1}{}{^{#1}}#2} \IfNoValueTF{#3}{}{(#3)}
}
}
\DeclareDocumentCommand\DD{}{\Differential}
\DeclareDocumentCommand\Variation{ o g d() }{
\IfNoValueTF{#2}{
\IfNoValueTF{#3}{
\Delta \IfNoValueTF{#1}{}{^{#1}}
}{
\mathinner{\Delta \IfNoValueTF{#1}{}{^{#1}}\argopen(#3\argclose)}}
}{
\mathinner{\Delta \IfNoValueTF{#1}{}{^{#1}}#2} \IfNoValueTF{#3}{}{(#3)}
}
}
\DeclareDocumentCommand\Var{}{\Variation}
%% other commands
\newcommand{\eg}{e.g.}
\newcommand{\etal}{et al}
\newcommand{\ie}{i.e.}
\newcommand{\unit}[1]{\mathrm{~#1}}
\newcommand{\axunit}[1]{\mathrm{~[#1]}}
\newcommand{\angstrom}{\text{\r A}}
\newcommand{\range}{\text{--}}
\newcommand{\E}[1]{\times 10^{#1}}
\newcommand{\simpropto}{\underset{\sim}{\propto}}
\newcommand{\cfill}[1]{\hspace*{0cm}\hfill{#1}\hfill\hspace*{0cm}}
\DeclareDocumentCommand\mean{s m}{
\IfBooleanTF{#1}
{ % \mean*{}
\langle {#2} \rangle
}{ % \mean{}
\left\langle {#2} \right\rangle
}
}
\newcommand{\ope}[1]{\hat{#1}}
\newcommand{\opevect}[1]{\hat{\vb{#1}}}
\DeclareDocumentCommand\atom{m g g g o}{
\IfNoValueTF{#5}{
\IfNoValueTF{#2}{
\mathrm{#1}
}{
\IfNoValueTF{#3}{
\prescript{#2}{}{\mathrm{#1}}
}{
\IfNoValueTF{#4}{
\prescript{#2}{#3}{\mathrm{#1}}
}{
\prescript{#2}{#3}{\mathrm{#1}}_{#4}
}}}}{
\IfNoValueTF{#2}{
\mathrm{#1}\text{\textsc{#5}}
}{
\IfNoValueTF{#3}{
\prescript{#2}{}{\mathrm{#1}\text{\textsc{#5}}}
}{
\IfNoValueTF{#4}{
\prescript{#2}{#3}{\mathrm{#1}\text{\textsc{#5}}}
}{
\prescript{#2}{#3}{\mathrm{#1}\text{\textsc{#5}}}_{#4}
}}}}
}
\DeclareDocumentCommand\underbraceset{m g}{
\IfNoValueTF{#2}{
\underbrace{#1}
}{
\underset{#1}{\underbrace{#2}}
}
}
\DeclareDocumentCommand\overbraceset{m g}{
\IfNoValueTF{#2}{
\overbrace{#1}
}{
\overset{#1}{\overbrace{#2}}
}
}
\let\eqdef\equiv
\let\ol\overline
\let\ul\underline
\let\name\text
% Note: "cases" should now be used instead of "system"

View File

@@ -1,18 +0,0 @@
import matplotlib.pyplot as plt
def test_colors():
x = range(10)
y = [1]*10
fig, ax = plt.subplots(1)
for i in x:
ax.scatter(x[i],y[i], s=100)
test_colors()
plt.style.use("YII_1")
test_colors()
plt.show()

730
ç Normal file
View File

@@ -0,0 +1,730 @@
#!/usr/bin/env python
#[TLP:CLEAR] UNLIMITED DISTRIBUTION
"""
manchot_plot.py
@ Author: Moussouni, Yaël (PhD student; yael.moussouni@astro.unistra.fr)
@ Institution: Université de Strasbourg, CNRS, Observatoire astronomique
de Strasbourg, UMR 7550, F-67000 Strasbourg, France
@ Date: 2025-11-21
Licence:
Python Matplotlib Style
Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
manchot_plot.py
Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see www.gnu.org/licenses/.
"""
import os
import matplotlib as mpl
import numpy as np
import colours as c
import matplotlib.pyplot as plt
from cycler import cycler
cm = 0.3937 # in/cm
class ManchotRC:
def __init__(self):
self.context = {}
# Paper
self.paper = (21*cm, 29.7*cm)
self.margin_left = 3*cm
self.margin_right = 3*cm
self.margin_cols = 0*cm
self.n_cols = 1
self.aspect = 3/2
self.page_linewidth = (self.paper[0] - self.margin_left - self.margin_right)
self.page_textwidth = self.page_linewidth/self.n_cols - self.margin_cols*(self.n_cols - 1)
# Global parameters
self.linewidth = 2
self.markersize = 3
self.pad = 3.5
self.joinstyle = "round"
self.fig_x = self.page_textwidth
self.fig_y = self.fig_x / self.aspect
# Colours
self.colour_fg = "#000000"
self.colour_bg = "#FFFFFF"
self.colours = [c.signal_blue,
c.signal_orange,
c.signal_green,
c.signal_red,
c.signal_violet,
c.signal_brown,
c.signal_pink,
c.signal_grey]
self.colour_fg_rgb = np.array(mpl.colors.to_rgb(self.colour_fg))
self.colour_bg_rgb = np.array(mpl.colors.to_rgb(self.colour_bg))
self.colour_mg_rgb = np.mean([self.colour_fg_rgb, self.colour_bg_rgb],
axis=0)
self.colour_mg = mpl.colors.to_hex(self.colour_mg_rgb)
self.colour_mbg_rgb = np.mean([self.colour_mg_rgb, self.colour_bg_rgb],
axis=0)
self.colour_mbg = mpl.colors.to_hex(self.colour_mbg_rgb)
self.colour_mfg_rgb = np.mean([self.colour_mg_rgb, self.colour_fg_rgb],
axis=0)
self.colour_mfg = mpl.colors.to_hex(self.colour_mfg_rgb)
# Lines
self.lines_linewidth = self.linewidth
self.lines_markersize = self.markersize
self.lines_linestyle = "-"
self.lines_marker = ""
self.lines_markeredgewidth = self.linewidth/2
self.lines_dash_joinstyle = self.joinstyle
self.lines_dash_capstyle = self.joinstyle
self.lines_solid_joinstyle = self.joinstyle
self.lines_solid_capstyle = self.joinstyle
self.lines_color = self.colours[0]
self.lines_markerfacecolor = "auto"
self.lines_markeredgecolor = self.lines_markerfacecolor
# Patches
self.patch_linewidth = self.linewidth
self.patch_force_edgecolor = False
self.patch_facecolor = self.colours[0]
self.patch_edgecolor = self.colour_fg
# Hatches
self.hatch_linewidth = self.linewidth/2
self.hatch_color = self.colour_fg
# Boxplots
self.boxplot_notch = False
self.boxplot_vertical = True
self.boxplot_whiskers = 1.5
self.boxplot_bootstrap = None
self.boxplot_patchartist = False
self.boxplot_showmeans = True
self.boxplot_showcaps = True
self.boxplot_showbox = True
self.boxplot_showfliers = True
self.boxplot_meanline = True
self.boxplot_flierprops_marker = "x"
self.boxplot_flierprops_markeredgewidth = self.linewidth/2
self.boxplot_flierprops_markersize = self.markersize
self.boxplot_flierprops_linestyle = ""
self.boxplot_flierprops_linewidth = self.linewidth
self.boxplot_boxprops_linewidth = self.linewidth
self.boxplot_boxprops_linestyle = "-"
self.boxplot_whiskerprops_linewidth = self.boxplot_boxprops_linewidth
self.boxplot_whiskerprops_linestyle = self.boxplot_boxprops_linestyle
self.boxplot_capprops_linewidth = self.boxplot_boxprops_linewidth
self.boxplot_capprops_linestyle = self.boxplot_boxprops_linestyle
self.boxplot_medianprops_linewidth = self.boxplot_boxprops_linewidth
self.boxplot_medianprops_linestyle = self.boxplot_boxprops_linestyle
self.boxplot_meanprops_marker = "+"
self.boxplot_meanprops_markersize = self.markersize
self.boxplot_meanprops_linestyle = self.boxplot_boxprops_linestyle
self.boxplot_meanprops_linewidth = self.boxplot_boxprops_linewidth
self.boxplot_flierprops_color = self.colour_mg
self.boxplot_flierprops_markerfacecolor = self.colour_fg
self.boxplot_flierprops_markeredgecolor = self.colour_fg
self.boxplot_boxprops_color = self.colour_fg
self.boxplot_whiskerprops_color = self.boxplot_boxprops_color
self.boxplot_capprops_color = self.boxplot_boxprops_color
self.boxplot_medianprops_color = self.colours[1]
self.boxplot_meanprops_color = self.colours[2]
self.boxplot_meanprops_markerfacecolor = self.boxplot_meanprops_color
self.boxplot_meanprops_markeredgecolor = self.boxplot_meanprops_color
# Font
font_list = mpl.font_manager.get_font_names()
if "Latin Modern Roman" in font_list :
self.font_family = "Latin Modern Roman"
elif "Computer Modern Roman" in font_list:
self.font_family = "Computer Modern Roman"
elif "Times" in font_list:
self.font_family = "Computer Modern Roman"
else:
self.font_family = "serif"
self.font_style = "normal"
self.font_variant = "normal"
self.font_weight = "normal"
self.font_stretch = "normal"
self.font_size = 10
self.font_serif = ["Computer Modern Roman",
"Latin Modern Roman",
"Times",
"serif"]
self.font_sans_serif = ["Computer Modern Sans Serif",
"Latin Modern Sans",
"Helvetica",
"Arial",
"sans-serif"]
self.font_monospace = ["Computer Modern Typewriter",
"Latin Modern Mono",
"Courier",
"monospace"]
# Text / LaTeX
self.text_usetex = False
self.latex_preamble = ""
self.mathtext_fontset = "cm"
self.text_color = self.colour_fg
# Axes
self.axes_linewidth = self.linewidth/2
self.axes_grid = True
self.axes_grid_axis = "both"
self.axes_grid_which = "major"
self.axes_titlelocation = "center"
self.axes_titley = None
self.axes_titlesize = "medium"
self.axes_titleweight = "normal"
self.axes_titlepad = self.pad
self.axes_labelsize = "medium"
self.axes_labelweight = "normal"
self.axes_labelpad = self.pad
self.axes_axisbelow = True
self.axes_facecolor = self.colour_bg
self.axes_edgecolor = self.colour_fg
self.axes_titlecolor = self.axes_edgecolor
self.axes_labelcolor = self.axes_edgecolor
self.axes_prop_cycle = cycler(color=self.colours)
self.axes_formatter_limits = (-5, 6)
self.axes_formatter_use_locale = False
self.axes_formatter_use_mathtext = False
self.axes_formatter_min_exponent = 0
self.axes_formatter_useoffset = True
self.axes_formatter_offset_threshold = 4
self.axes_spines_left = True
self.axes_spines_bottom = True
self.axes_spines_top = True
self.axes_spines_right = True
self.axes_unicode_minus = True
self.axes_xmargin = 0.05
self.axes_ymargin = 0.05
self.axes_zmargin = 0.05
self.axes_autolimit_mode = "data"
self.polaraxes_grid = True
self.axes3d_grid = True
self.axes3d_automargin = False
self.axes3d_xaxis_panecolor = np.concatenate([self.colour_mg_rgb, [0.05]])
self.axes3d_yaxis_panecolor = np.concatenate([self.colour_mg_rgb, [0.10]])
self.axes3d_zaxis_panecolor = np.concatenate([self.colour_mg_rgb, [0.15]])
self.axes3d_mouserotationstyle = "trackball"
self.axes3d_trackballsize = 0.667
self.axes3d_trackballborder = 0.2
# Axis
self.xaxis_labellocation = "center"
self.yaxis_labellocation = "center"
# Dates
self.date_autoformatter_year = "%Y"
self.date_autoformatter_month = "%Y-%m"
self.date_autoformatter_day = "%Y-%m-%d"
self.date_autoformatter_hour = "%m-%d%H"
self.date_autoformatter_minute = "%d%H:%M"
self.date_autoformatter_second = "%H:%M:%S"
self.date_autoformatter_microsecond = "%M:%S.%f"
self.date_converter = "auto"
self.date_interval_multiples = True
# Ticks
self.xtick_top = True
self.xtick_bottom = True
self.xtick_labeltop = False
self.xtick_labelbottom = True
self.xtick_major_size = self.linewidth*2
self.xtick_minor_size = self.xtick_major_size/2
self.xtick_major_width = self.linewidth/2
self.xtick_minor_width = self.xtick_major_width
self.xtick_major_pad = self.pad
self.xtick_minor_pad = self.pad
self.xtick_color = self.colour_fg
self.xtick_labelcolor = self.xtick_color
self.xtick_labelsize = "medium"
self.xtick_direction = "in"
self.xtick_minor_visible = False
self.xtick_major_top = True
self.xtick_major_bottom = True
self.xtick_minor_top = True
self.xtick_minor_bottom = True
self.xtick_minor_ndivs = "auto"
self.xtick_alignment = "center"
self.ytick_left = self.xtick_bottom
self.ytick_right = self.xtick_top
self.ytick_labelleft = self.xtick_labelbottom
self.ytick_labelright = self.xtick_labeltop
self.ytick_major_size = self.xtick_major_size
self.ytick_minor_size = self.xtick_minor_size
self.ytick_major_width = self.xtick_major_width
self.ytick_minor_width = self.xtick_minor_width
self.ytick_major_pad = self.xtick_major_pad
self.ytick_minor_pad = self.xtick_minor_pad
self.ytick_color = self.xtick_color
self.ytick_labelcolor = self.xtick_labelcolor
self.ytick_labelsize = self.xtick_labelsize
self.ytick_direction = self.xtick_direction
self.ytick_minor_visible = self.xtick_minor_visible
self.ytick_major_left = self.xtick_major_bottom
self.ytick_major_right = self.xtick_major_top
self.ytick_minor_left = self.xtick_minor_bottom
self.ytick_minor_right = self.xtick_minor_top
self.ytick_minor_ndivs = self.xtick_minor_ndivs
self.ytick_alignment = "center_baseline"
# Grids
self.grid_color = self.colour_mbg
self.grid_linestyle = ":"
self.grid_linewidth = self.linewidth/2
self.grid_alpha = 1
# Legend
self.legend_loc = "best"
self.legend_frameon = True
self.legend_framealpha = 0.8
self.legend_facecolor = self.colour_bg
self.legend_edgecolor = self.colour_mbg
self.legend_fancybox = True
self.legend_shadow = False
self.legend_numpoints = 1
self.legend_scatterpoints = 1
self.legend_markerscale = 1.0
self.legend_fontsize = "medium"
self.legend_labelcolor = self.colour_fg
self.legend_title_fontsize = None
self.legend_borderpad = 0.4
self.legend_labelspacing = 0.5
self.legend_handlelength = 2.0
self.legend_handleheight = 0.7
self.legend_handletextpad = 0.8
self.legend_borderaxespad = 0.5
self.legend_columnspacing = 2.0
# Figure
self.figure_titlesize = "medium"
self.figure_titleweight = "normal"
self.figure_labelsize = "medium"
self.figure_labelweight = "normal"
self.figure_figsize = self.fig_x, self.fig_y
self.figure_dpi = 150
self.figure_facecolor = self.colour_bg
self.figure_edgecolor = self.colour_bg
self.figure_frameon = True
self.figure_subplot_left = 0.125
self.figure_subplot_right = 0.9
self.figure_subplot_bottom = 0.11
self.figure_subplot_top = 0.88
self.figure_subplot_wspace = 0.2
self.figure_subplot_hspace = 0.2
self.figure_autolayout = False
self.figure_constrained_layout_use = True
self.figure_constrained_layout_h_pad = 0.04
self.figure_constrained_layout_w_pad = 0.04
self.figure_constrained_layout_hspace = 0.02
self.figure_constrained_layout_wspace = 0.02
# Images
self.image_aspect = "equal"
self.image_interpolation = "auto"
self.image_interpolation_stage = "auto"
self.image_cmap = "viridis"
self.image_lut = 256
self.image_origin = "upper"
self.image_resample = True
self.image_composite_image = True
# Contour, error bar, histogram and scatter
self.contour_negative_linestyle = "dashed"
self.contour_corner_mask = True
self.contour_linewidth = self.linewidth
self.contour_algorithm = "mpl2014"
self.errorbar_capsize = self.markersize
self.hist_bins = 10
self.scatter_marker = "o"
self.scatter_edgecolors = "face"
# Savefig
self.savefig_dpi = 300
self.savefig_facecolor = "auto"
self.savefig_edgecolor = "auto"
self.savefig_format = "pdf"
self.savefig_bbox = "standard"
self.savefig_pad_inches = 0
self.savefig_transparent = True
# Compute
self._compute()
return None
def _compute(self):
self.context = {}
# Paper
margin = self.margin_left + self.margin_right \
+ (self.n_cols - 1) * self.margin_cols
figsize_x = self.paper[0]/self.n_cols - margin
figsize_y = figsize_x / self.aspect
# Lines
self.context["lines.linewidth"] = self.lines_linewidth
self.context["lines.linestyle"] = self.lines_linestyle
self.context["lines.color"] = self.lines_color
self.context["lines.marker"] = self.lines_marker
self.context["lines.markerfacecolor"] = self.lines_markerfacecolor
self.context["lines.markeredgecolor"] = self.lines_markeredgecolor
self.context["lines.markeredgewidth"] = self.lines_markeredgewidth
self.context["lines.markersize"] = self.lines_markersize
self.context["lines.dash_joinstyle"] = self.lines_dash_joinstyle
self.context["lines.dash_capstyle"] = self.lines_dash_capstyle
self.context["lines.solid_joinstyle"] = self.lines_solid_joinstyle
self.context["lines.solid_capstyle"] = self.lines_solid_capstyle
# Patches
self.context["patch.linewidth"] = self.patch_linewidth
self.context["patch.facecolor"] = self.patch_facecolor
self.context["patch.edgecolor"] = self.patch_edgecolor
self.context["patch.force_edgecolor"] = self.patch_force_edgecolor
# Boxplot
self.context["boxplot.notch"] = self.boxplot_notch
self.context["boxplot.vertical"] = self.boxplot_vertical
self.context["boxplot.whiskers"] = self.boxplot_whiskers
self.context["boxplot.bootstrap"] = self.boxplot_bootstrap
self.context["boxplot.patchartist"] = self.boxplot_patchartist
self.context["boxplot.showmeans"] = self.boxplot_showmeans
self.context["boxplot.showcaps"] = self.boxplot_showcaps
self.context["boxplot.showbox"] = self.boxplot_showbox
self.context["boxplot.showfliers"] = self.boxplot_showfliers
self.context["boxplot.meanline"] = self.boxplot_meanline
self.context["boxplot.flierprops.color"] = self.boxplot_flierprops_color
self.context["boxplot.flierprops.marker"] = self.boxplot_flierprops_marker
self.context["boxplot.flierprops.markerfacecolor"] = self.boxplot_flierprops_markerfacecolor
self.context["boxplot.flierprops.markeredgecolor"] = self.boxplot_flierprops_markeredgecolor
self.context["boxplot.flierprops.markeredgewidth"] = self.boxplot_flierprops_markeredgewidth
self.context["boxplot.flierprops.markersize"] = self.boxplot_flierprops_markersize
self.context["boxplot.flierprops.linestyle"] = self.boxplot_flierprops_linestyle
self.context["boxplot.flierprops.linewidth"] = self.boxplot_flierprops_linewidth
self.context["boxplot.boxprops.color"] = self.boxplot_boxprops_color
self.context["boxplot.boxprops.linewidth"] = self.boxplot_boxprops_linewidth
self.context["boxplot.boxprops.linestyle"] = self.boxplot_boxprops_linestyle
self.context["boxplot.whiskerprops.color"] = self.boxplot_whiskerprops_color
self.context["boxplot.whiskerprops.linewidth"] = self.boxplot_whiskerprops_linewidth
self.context["boxplot.whiskerprops.linestyle"] = self.boxplot_whiskerprops_linestyle
self.context["boxplot.capprops.color"] = self.boxplot_capprops_color
self.context["boxplot.capprops.linewidth"] = self.boxplot_capprops_linewidth
self.context["boxplot.capprops.linestyle"] = self.boxplot_capprops_linestyle
self.context["boxplot.medianprops.color"] = self.boxplot_medianprops_color
self.context["boxplot.medianprops.linewidth"] = self.boxplot_medianprops_linewidth
self.context["boxplot.medianprops.linestyle"] = self.boxplot_medianprops_linestyle
self.context["boxplot.meanprops.color"] = self.boxplot_meanprops_color
self.context["boxplot.meanprops.marker"] = self.boxplot_meanprops_marker
self.context["boxplot.meanprops.markerfacecolor"] = self.boxplot_meanprops_markerfacecolor
self.context["boxplot.meanprops.markeredgecolor"] = self.boxplot_meanprops_markeredgecolor
self.context["boxplot.meanprops.linestyle"] = self.boxplot_meanprops_linestyle
self.context["boxplot.meanprops.linewidth"] = self.boxplot_meanprops_linewidth
# Font
self.context["font.family"] = self.font_family
self.context["font.style"] = self.font_style
self.context["font.variant"] = self.font_variant
self.context["font.weight"] = self.font_weight
self.context["font.stretch"] = self.font_stretch
self.context["font.size"] = self.font_size
self.context["font.serif"] = self.font_serif
self.context["font.sans-serif"] = self.font_sans_serif
self.context["font.monospace"] = self.font_monospace
# Text / LaTeX
self.context["text.usetex"] = self.text_usetex
self.context["text.latex.preamble"] = self.latex_preamble
self.context["mathtext.fontset"] = self.mathtext_fontset
# Axes
self.context["axes.facecolor"] = self.axes_facecolor
self.context["axes.edgecolor"] = self.axes_edgecolor
self.context["axes.linewidth"] = self.axes_linewidth
self.context["axes.grid"] = self.axes_grid
self.context["axes.grid.axis"] = self.axes_grid_axis
self.context["axes.grid.which"] = self.axes_grid_which
self.context["axes.titlelocation"] = self.axes_titlelocation
self.context["axes.titlesize"] = self.axes_titlesize
self.context["axes.titleweight"] = self.axes_titleweight
self.context["axes.titlecolor"] = self.axes_titlecolor
self.context["axes.titley"] = self.axes_titley
self.context["axes.titlepad"] = self.axes_titlepad
self.context["axes.labelsize"] = self.axes_labelsize
self.context["axes.labelpad"] = self.axes_labelpad
self.context["axes.labelweight"] = self.axes_labelweight
self.context["axes.labelcolor"] = self.axes_labelcolor
self.context["axes.axisbelow"] = self.axes_axisbelow
self.context["axes.prop_cycle"] = self.axes_prop_cycle
# Axes
self.context["axes.formatter.limits"] = self.axes_formatter_limits
self.context["axes.formatter.use_locale"] = self.axes_formatter_use_locale
self.context["axes.formatter.use_mathtext"] = self.axes_formatter_use_mathtext
self.context["axes.formatter.min_exponent"] = self.axes_formatter_min_exponent
self.context["axes.formatter.useoffset"] = self.axes_formatter_useoffset
self.context["axes.formatter.offset_threshold"] = self.axes_formatter_offset_threshold
self.context["axes.spines.left"] = self.axes_spines_left
self.context["axes.spines.bottom"] = self.axes_spines_bottom
self.context["axes.spines.top"] = self.axes_spines_top
self.context["axes.spines.right"] = self.axes_spines_right
self.context["axes.unicode_minus"] = self.axes_unicode_minus
self.context["axes.xmargin"] = self.axes_xmargin
self.context["axes.ymargin"] = self.axes_ymargin
self.context["axes.zmargin"] = self.axes_zmargin
self.context["axes.autolimit_mode"] = self.axes_autolimit_mode
self.context["polaraxes.grid"] = self.polaraxes_grid
self.context["axes3d.grid"] = self.axes3d_grid
self.context["axes3d.automargin"] = self.axes3d_automargin
self.context["axes3d.xaxis.panecolor"] = self.axes3d_xaxis_panecolor
self.context["axes3d.yaxis.panecolor"] = self.axes3d_yaxis_panecolor
self.context["axes3d.zaxis.panecolor"] = self.axes3d_zaxis_panecolor
self.context["axes3d.mouserotationstyle"] = self.axes3d_mouserotationstyle
self.context["axes3d.trackballsize"] = self.axes3d_trackballsize
self.context["axes3d.trackballborder"] = self.axes3d_trackballborder
# Axis
self.context["xaxis.labellocation"] = self.xaxis_labellocation
self.context["yaxis.labellocation"] = self.yaxis_labellocation
# Dates
self.context["date.autoformatter.year"] = self.date_autoformatter_year
self.context["date.autoformatter.month"] = self.date_autoformatter_month
self.context["date.autoformatter.day"] = self.date_autoformatter_day
self.context["date.autoformatter.hour"] = self.date_autoformatter_hour
self.context["date.autoformatter.minute"] = self.date_autoformatter_minute
self.context["date.autoformatter.second"] = self.date_autoformatter_second
self.context["date.autoformatter.microsecond"] = self.date_autoformatter_microsecond
self.context["date.converter"] = self.date_converter
self.context["date.interval_multiples"] = self.date_interval_multiples
# Ticks
self.context["xtick.top"] = self.xtick_top
self.context["xtick.bottom"] = self.xtick_bottom
self.context["xtick.labeltop"] = self.xtick_labeltop
self.context["xtick.labelbottom"] = self.xtick_labelbottom
self.context["xtick.major.size"] = self.xtick_major_size
self.context["xtick.minor.size"] = self.xtick_minor_size
self.context["xtick.major.width"] = self.xtick_major_width
self.context["xtick.minor.width"] = self.xtick_minor_width
self.context["xtick.major.pad"] = self.xtick_major_pad
self.context["xtick.minor.pad"] = self.xtick_minor_pad
self.context["xtick.color"] = self.xtick_color
self.context["xtick.labelcolor"] = self.xtick_labelcolor
self.context["xtick.labelsize"] = self.xtick_labelsize
self.context["xtick.direction"] = self.xtick_direction
self.context["xtick.minor.visible"] = self.xtick_minor_visible
self.context["xtick.major.top"] = self.xtick_major_top
self.context["xtick.major.bottom"] = self.xtick_major_bottom
self.context["xtick.minor.top"] = self.xtick_minor_top
self.context["xtick.minor.bottom"] = self.xtick_minor_bottom
self.context["xtick.minor.ndivs"] = self.xtick_minor_ndivs
self.context["xtick.alignment"] = self.xtick_alignment
self.context["ytick.left"] = self.ytick_left
self.context["ytick.right"] = self.ytick_right
self.context["ytick.labelleft"] = self.ytick_labelleft
self.context["ytick.labelright"] = self.ytick_labelright
self.context["ytick.major.size"] = self.ytick_major_size
self.context["ytick.minor.size"] = self.ytick_minor_size
self.context["ytick.major.width"] = self.ytick_major_width
self.context["ytick.minor.width"] = self.ytick_minor_width
self.context["ytick.major.pad"] = self.ytick_major_pad
self.context["ytick.minor.pad"] = self.ytick_minor_pad
self.context["ytick.color"] = self.ytick_color
self.context["ytick.labelcolor"] = self.ytick_labelcolor
self.context["ytick.labelsize"] = self.ytick_labelsize
self.context["ytick.direction"] = self.ytick_direction
self.context["ytick.minor.visible"] = self.ytick_minor_visible
self.context["ytick.major.left"] = self.ytick_major_left
self.context["ytick.major.right"] = self.ytick_major_right
self.context["ytick.minor.left"] = self.ytick_minor_left
self.context["ytick.minor.right"] = self.ytick_minor_right
self.context["ytick.minor.ndivs"] = self.ytick_minor_ndivs
self.context["ytick.alignment"] = self.ytick_alignment
# Grid
self.context["grid.color"] = self.grid_color
self.context["grid.linestyle"] = self.grid_linestyle
self.context["grid.linewidth"] = self.grid_linewidth
self.context["grid.alpha"] = self.grid_alpha
# Legend
self.context["legend.loc"] = self.legend_loc
self.context["legend.frameon"] = self.legend_frameon
self.context["legend.framealpha"] = self.legend_framealpha
self.context["legend.facecolor"] = self.legend_facecolor
self.context["legend.edgecolor"] = self.legend_edgecolor
self.context["legend.fancybox"] = self.legend_fancybox
self.context["legend.shadow"] = self.legend_shadow
self.context["legend.numpoints"] = self.legend_numpoints
self.context["legend.scatterpoints"] = self.legend_scatterpoints
self.context["legend.markerscale"] = self.legend_markerscale
self.context["legend.fontsize"] = self.legend_fontsize
self.context["legend.labelcolor"] = self.legend_labelcolor
self.context["legend.title_fontsize"] = self.legend_title_fontsize
self.context["legend.borderpad"] = self.legend_borderpad
self.context["legend.labelspacing"] = self.legend_labelspacing
self.context["legend.handlelength"] = self.legend_handlelength
self.context["legend.handleheight"] = self.legend_handleheight
self.context["legend.handletextpad"] = self.legend_handletextpad
self.context["legend.borderaxespad"] = self.legend_borderaxespad
self.context["legend.columnspacing"] = self.legend_columnspacing
# Figure
self.context["figure.titlesize"] = self.figure_titlesize
self.context["figure.titleweight"] = self.figure_titleweight
self.context["figure.labelsize"] = self.figure_labelsize
self.context["figure.labelweight"] = self.figure_labelweight
self.context["figure.figsize"] = self.figure_figsize
self.context["figure.dpi"] = self.figure_dpi
self.context["figure.facecolor"] = self.figure_facecolor
self.context["figure.edgecolor"] = self.figure_edgecolor
self.context["figure.frameon"] = self.figure_frameon
self.context["figure.subplot.left"] = self.figure_subplot_left
self.context["figure.subplot.right"] = self.figure_subplot_right
self.context["figure.subplot.bottom"] = self.figure_subplot_bottom
self.context["figure.subplot.top"] = self.figure_subplot_top
self.context["figure.subplot.wspace"] = self.figure_subplot_wspace
self.context["figure.subplot.hspace"] = self.figure_subplot_hspace
self.context["figure.autolayout"] = self.figure_autolayout
self.context["figure.constrained_layout.use"] = self.figure_constrained_layout_use
self.context["figure.constrained_layout.h_pad"] = self.figure_constrained_layout_h_pad
self.context["figure.constrained_layout.w_pad"] = self.figure_constrained_layout_w_pad
self.context["figure.constrained_layout.hspace"] = self.figure_constrained_layout_hspace
self.context["figure.constrained_layout.wspace"] = self.figure_constrained_layout_wspace
# Images
self.context["image.aspect"] = self.image_aspect
self.context["image.interpolation"] = self.image_interpolation
self.context["image.interpolation_stage"] = self.image_interpolation_stage
self.context["image.cmap"] = self.image_cmap
self.context["image.lut"] = self.image_lut
self.context["image.origin"] = self.image_origin
self.context["image.resample"] = self.image_resample
self.context["image.composite_image"] = self.image_composite_image
# Contour, error bar, histogram and scatter
self.context["contour.negative_linestyle"] = self.contour_negative_linestyle
self.context["contour.corner_mask"] = self.contour_corner_mask
self.context["contour.linewidth"] = self.contour_linewidth
self.context["contour.algorithm"] = self.contour_algorithm
self.context["errorbar.capsize"] = self.errorbar_capsize
self.context["hist.bins"] = self.hist_bins
self.context["scatter.marker"] = self.scatter_marker
self.context["scatter.edgecolors"] = self.scatter_edgecolors
# Savefig
self.context["savefig.dpi"] = self.savefig_dpi
self.context["savefig.facecolor"] = self.savefig_facecolor
self.context["savefig.edgecolor"] = self.savefig_edgecolor
self.context["savefig.format"] = self.savefig_format
self.context["savefig.bbox"] = self.savefig_bbox
self.context["savefig.pad_inches"] = self.savefig_pad_inches
self.context["savefig.transparent"] = self.savefig_transparent
return None
from mpl_toolkits.mplot3d import axes3d
if __name__ == "__main__":
rc = ManchotRC()
with plt.style.context(rc.context):
fig, axs = plt.subplots(1, 3)
fig.suptitle("Default plot")
axs[0].plot([0,1,2,3,4], [2,1,4,3,6], label="curve 1")
axs[0].plot([0,1,2,3,4], [4,3,1,2,4], "o--", label="curve 2")
axs[0].set_title("Lorem")
axs[0].set_xlabel("$x~\\mathrm{[cm]}$")
axs[0].set_ylabel("$y~\\mathrm{[cm]}$")
axs[0].legend()
axs[1].scatter([0,1,2,3,4], [2,1,4,3,6])
axs[1].scatter([0,1,2,3,4], [4,3,1,2,4], s=[1,2,3,4,6])
axs[1].set_title("Ipsum")
axs[1].set_xlabel("$x~\\mathrm{[cm]}$")
axs[1].set_ylabel("$y~\\mathrm{[cm]}$")
axs[1].text(2, 2, "sample text")
axs[2].set_title("Dolor")
axs[2].bar([1,2], [3,2])
axs[2].bar([3,4], [3,4], hatch="/")
axs[2].boxplot([[2,4,6,4,6,4,6,5,6,6,7,7,8,7,5],
[1,4,6,5,6,7,5,3,5,6,7],
[2,6,5,6,6,4,5,6,7,5,4,5,2]])
axs[2].set_xlabel("Value")
axs[2].set_ylabel("Number")
fig = plt.figure()
ax = fig.add_subplot(projection="3d")
X, Y, Z = axes3d.get_test_data(0.05)
# Plot the 3D surface
ax.plot_surface(X, Y, Z, edgecolor='C0', lw=0.5, rstride=8, cstride=8,
alpha=0.3)
# Plot projections of the contours for each dimension. By choosing offsets
# that match the appropriate axes limits, the projected contours will sit on
# the 'walls' of the graph.
ax.contour(X, Y, Z, zdir='z', offset=-100)
ax.contour(X, Y, Z, zdir='x', offset=-40)
ax.contour(X, Y, Z, zdir='y', offset=40)
ax.set(xlim=(-40, 40), ylim=(-40, 40), zlim=(-100, 100),
xlabel='X', ylabel='Y', zlabel='Z')
plt.show()