mirror of
https://codeberg.org/Yael-II/Matplotlib-Style.git
synced 2026-03-15 05:46:26 +01:00
Compare commits
5 Commits
main
...
e5f53bc7e5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5f53bc7e5 | ||
|
|
b89733cafd | ||
|
|
475595f0c8 | ||
|
|
55e7ba0814 | ||
|
|
7178c3de85 |
22
README.md
22
README.md
@@ -1,26 +1,24 @@
|
||||
<!--[TLP:AMBER] LIMITED DISTRIBUTION: WORK IN PROGRESS-->
|
||||
<!--[TLP:CLEAR] UNLIMITED DISTRIBUTION-->
|
||||
```diff
|
||||
! [TLP:AMBER] LIMITED DISTRIBUTION: WORK IN PROGRESS
|
||||
[TLP:CLEAR] UNLIMITED DISTRIBUTION
|
||||
```
|
||||
# Python Matplotlib Style
|
||||
|
||||
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
|
||||
# MANCHOT PYthon packaGe to make Matplotlib figures Elegant and Easy (MANCHOT PYGMEE)
|
||||
|
||||
Date: 2025-11-21
|
||||
Author: Moussouni, Yaël (<contact.ial-2@proton.me>)\
|
||||
Institution: Université de Strasbourg, CNRS, Observatoire astronomique de Strasbourg, UMR 7550, F-67000 Strasbourg, France\
|
||||
Date: 2025-02-01
|
||||
|
||||
## WARNING: WORK IN PROGRESS
|
||||
## Description
|
||||
|
||||
**The current version of the scripts in this repository is in development. Please use with extreme caution, significant and reliable results cannot be guaranteed.**
|
||||
This is work in progress.
|
||||
|
||||
## Licence
|
||||
|
||||
**MSc2 Internship: SMACS Cluster**
|
||||
**MANCHOT-PYGMEE**
|
||||
|
||||
Copyright (C) 2025 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see www.gnu.org/licenses/.
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
#
|
||||
# Licence:
|
||||
# MSc2 Internship: SMACS Cluster
|
||||
# Copyright (C) 2025 Yaël Moussouni (yael.moussouni@etu.unistra.fr)
|
||||
# Copyright (C) 2026 Yaël Moussouni (yael.moussouni@etu.unistra.fr)
|
||||
#
|
||||
# activate.sh
|
||||
# Copyright (C) 2025 Yaël Moussouni (yael.moussouni@etu.unistra.fr)
|
||||
# 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
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
#
|
||||
# Licence:
|
||||
# Python Matplotlib Style
|
||||
# Copyright (C) 2025 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
|
||||
# Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
|
||||
#
|
||||
# pyproject.toml
|
||||
# Copyright (C) 2025 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
|
||||
# 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
|
||||
|
||||
@@ -8,5 +8,8 @@ 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
|
||||
|
||||
@@ -10,10 +10,10 @@ __init__.py
|
||||
|
||||
Licence:
|
||||
Python Matplotlib Style
|
||||
Copyright (C) 2025 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
|
||||
Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
|
||||
|
||||
__init__.py
|
||||
Copyright (C) 2025 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
|
||||
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
|
||||
|
||||
@@ -11,10 +11,10 @@ manchot_plot.py
|
||||
|
||||
Licence:
|
||||
Python Matplotlib Style
|
||||
Copyright (C) 2025 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
|
||||
Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
|
||||
|
||||
manchot_plot.py
|
||||
Copyright (C) 2025 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
|
||||
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
|
||||
@@ -29,65 +29,31 @@ 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"
|
||||
|
||||
# Default palette
|
||||
colour_blue = "#113847"
|
||||
colour_light_blue = "#88AAC6"
|
||||
colour_red = "#4D251D"
|
||||
colour_yellow = "#BD9A5A"
|
||||
colour_green = "#3F4738"
|
||||
colour_violet = "#5F2C51"
|
||||
colour_cyan = "#1D627E"
|
||||
colour_orange = "#9B4D40"
|
||||
ral_350_50_45 = "#a6507e"
|
||||
|
||||
colour_purple = colour_violet
|
||||
|
||||
# Bright palette
|
||||
bright_white = "#DDDDDD"
|
||||
bright_black = "#121212"
|
||||
|
||||
bright_blue = "#06518E"
|
||||
bright_light_blue = "#009EDB"
|
||||
bright_red = "#ED1C24"
|
||||
bright_yellow = "#E8BD0F"
|
||||
bright_green = "#3B795E"
|
||||
bright_violet = "#C95BCF"
|
||||
bright_cyan = "#216576"
|
||||
bright_light_cyan = "#1E8C9D"
|
||||
bright_orange = "#EB6D1A"
|
||||
bright_purple = bright_violet
|
||||
|
||||
# Blue palette
|
||||
blues_1 = "#D6E3EC"
|
||||
blues_2 = "#88AAC6" # light blue
|
||||
blues_3 = "#4A5B65"
|
||||
blues_4 = "#21475A"
|
||||
blues_5 = "#113847" # blue
|
||||
|
||||
# Grey palette
|
||||
greys_1 = "#CED8DB" # white
|
||||
greys_2 = "#A4B0B4"
|
||||
greys_3 = "#7A888C" # grey
|
||||
greys_4 = "#596569"
|
||||
greys_5 = "#171F22" # black
|
||||
|
||||
colour_white = greys_1
|
||||
colour_grey = greys_3
|
||||
colour_black = greys_5
|
||||
|
||||
# bluegreen palette
|
||||
bluegreen_1 = "#C2D0DB"
|
||||
bluegreen_2 = "#6C8B90"
|
||||
bluegreen_3 = "#4D6C5B"
|
||||
bluegreen_4 = "#3A5662"
|
||||
bluegreen_5 = "#31504B"
|
||||
|
||||
# tree palette
|
||||
tree_1 = "#CFDED7"
|
||||
tree_2 = "#806655" # brown
|
||||
tree_3 = "#3F4738" # green
|
||||
tree_4 = "#113847" # blue
|
||||
tree_5 = "#122921" # dark green
|
||||
|
||||
colour_brown = tree_2
|
||||
colour_dark_green = tree_5
|
||||
# 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
|
||||
|
||||
@@ -10,10 +10,10 @@ manchot_plot.py
|
||||
|
||||
Licence:
|
||||
Python Matplotlib Style
|
||||
Copyright (C) 2025 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
|
||||
Copyright (C) 2026 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
|
||||
|
||||
manchot_plot.py
|
||||
Copyright (C) 2025 Yaël Moussouni (yael.moussouni@astro.unistra.fr)
|
||||
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
|
||||
@@ -52,78 +52,371 @@ class ManchotRC:
|
||||
self.n_cols = 1
|
||||
self.aspect = 3/2
|
||||
|
||||
# Global parameters
|
||||
self.linewidth = 2
|
||||
self.markersize = 3
|
||||
|
||||
# Colours
|
||||
self.colour_fg = "#000000"
|
||||
self.colour_mg = "#7F7F7F"
|
||||
self.colour_bg = "#FFFFFF"
|
||||
self.colours = [c.bright_blue, c.bright_yellow]
|
||||
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]
|
||||
|
||||
# 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 = "round"
|
||||
self.lines_dash_capstyle = "round"
|
||||
self.lines_solid_joinstyle = "round"
|
||||
self.lines_solid_capstyle = "round"
|
||||
self.lines_color = self.colours[0]
|
||||
self.lines_markerfacecolor = "auto"
|
||||
self.lines_markeredgecolor = "auto"
|
||||
|
||||
# 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 = 6.0
|
||||
self.axes_labelsize = "medium"
|
||||
self.axes_labelweight = "normal"
|
||||
self.axes_labelpad = 4.0
|
||||
self.axes_axisbelow = "line"
|
||||
self.axes_facecolor = self.colour_bg
|
||||
self.axes_edgecolor = self.colour_fg
|
||||
self.axes_labelcolor = 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 = (0.95,0.95,0.95,0.5)
|
||||
self.axes3d_yaxis_panecolor = (0.90,0.90,0.90,0.5)
|
||||
self.axes3d_zaxis_panecolor = (0.925,0.925,0.925,0.5)
|
||||
self.axes3d_mouserotationstyle = "arcball"
|
||||
self.axes3d_trackballsize = 0.667
|
||||
self.axes3d_trackballborder = 0.2
|
||||
|
||||
|
||||
|
||||
# XXX START BACK HERE
|
||||
|
||||
|
||||
# Figure
|
||||
self.figure_dpi = 150
|
||||
self.savefig_dpi = 300
|
||||
self.savefig_transparent = True
|
||||
|
||||
# Font
|
||||
self.font_family = "serif"
|
||||
self.font_serif = "Latin Modern Roman"
|
||||
self.font_size = 10
|
||||
|
||||
# Text / LaTeX
|
||||
self.text_usetex = True
|
||||
self.latex_preamble = ""
|
||||
|
||||
# Axes
|
||||
|
||||
self.axes_titlesize = "large"
|
||||
self.axes_labelsize = "medium"
|
||||
|
||||
# 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
|
||||
|
||||
# Colours
|
||||
|
||||
# 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
|
||||
|
||||
# Figure
|
||||
self.context["figure.figsize"] = (figsize_x, figsize_y)
|
||||
self.context["figure.dpi"] = self.figure_dpi
|
||||
|
||||
self.context["savefig.dpi"] = self.savefig_dpi
|
||||
self.context["savefig.transparent"] = self.savefig_transparent
|
||||
|
||||
# Font
|
||||
self.context["font.family"] = self.font_family
|
||||
self.context["font.serif"] = self.font_serif
|
||||
self.context["font.size"] = self.font_size
|
||||
# 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
|
||||
|
||||
# Text / LaTeX
|
||||
self.context["text.usetex"] = self.text_usetex
|
||||
self.context["text.latex.preamble"] = self.latex_preamble
|
||||
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
|
||||
return None
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
rc = ManchotRC()
|
||||
|
||||
print(rc.context)
|
||||
|
||||
with plt.style.context(rc.context):
|
||||
fig, ax = plt.subplots(1)
|
||||
ax.plot([0,1,2,3,4], [2,1,4,3,6])
|
||||
ax.plot([0,1,2,3,4], [4,3,1,2,4])
|
||||
ax.set_xlabel("$x\\ \\mathrm{[cm]}$")
|
||||
ax.set_ylabel("$y\\ \\mathrm{[cm]}$")
|
||||
fig, axs = plt.subplots(1, 3)
|
||||
axs[0].plot([0,1,2,3,4], [2,1,4,3,6])
|
||||
axs[0].plot([0,1,2,3,4], [4,3,1,2,4], "--")
|
||||
|
||||
axs[0].set_title("Lorem")
|
||||
axs[0].set_xlabel("$x~\\mathrm{[cm]}$")
|
||||
axs[0].set_ylabel("$y~\\mathrm{[cm]}$")
|
||||
|
||||
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.tight_layout() # NOTE: Temporary
|
||||
plt.show()
|
||||
|
||||
Reference in New Issue
Block a user