aptapy 0.1.1__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
aptapy/_version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.1"
1
+ __version__ = "0.2.0"
aptapy/hist.py ADDED
@@ -0,0 +1,226 @@
1
+ # Copyright (C) 2025 Luca Baldini (luca.baldini@pi.infn.it)
2
+ #
3
+ # This program is free software: you can redistribute it and/or modify
4
+ # it under the terms of the GNU General Public License as published by
5
+ # the Free Software Foundation, either version 3 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
15
+
16
+ """Histogram facilities.
17
+ """
18
+
19
+ from abc import ABC, abstractmethod
20
+ from typing import List, Sequence
21
+
22
+ import numpy as np
23
+
24
+ from .plotting import matplotlib, plt, setup_axes
25
+ from .typing_ import ArrayLike
26
+
27
+
28
+ class AbstractHistogram(ABC):
29
+
30
+ """Abstract base class for an n-dimensional histogram.
31
+
32
+ Arguments
33
+ ---------
34
+ edges : n-dimensional sequence of arrays
35
+ the bin edges on the different axes.
36
+
37
+ labels : sequence of strings
38
+ the text labels for the different axes.
39
+ """
40
+
41
+ DEFAULT_PLOT_OPTIONS = {}
42
+
43
+ def __init__(self, edges: Sequence[np.ndarray], labels: List[str]) -> None:
44
+ """Constructor.
45
+ """
46
+ # Edges are fixed once and forever, so we create a copy. Also, no matter
47
+ # which kind of sequence we are passing, we turn the thing into a tuple.
48
+ self._edges = tuple(np.asarray(item, dtype=float).copy() for item in edges)
49
+ self._num_axes = len(self._edges)
50
+
51
+ # And a few basic checks on the input arguments.
52
+ for item in self._edges:
53
+ if item.ndim != 1:
54
+ raise ValueError(f"Bin edges {item} are not a 1-dimensional array.")
55
+ if item.size < 2:
56
+ raise ValueError(f"Bin edges {item} have less than 2 entries.")
57
+ if np.any(np.diff(item) <= 0):
58
+ raise ValueError(f"Bin edges {item} not strictly increasing.")
59
+ if labels is not None and len(labels) > self._num_axes + 1:
60
+ raise ValueError(f"Too many labels {labels} for {self._num_axes} axes.")
61
+
62
+ # Go ahead and create all the necessary data structures.
63
+ self._shape = tuple(item.size - 1 for item in self._edges)
64
+ self._sumw = np.zeros(self._shape, dtype=float)
65
+ self._sumw2 = np.zeros(self._shape, dtype=float)
66
+ self._labels = labels
67
+
68
+ @property
69
+ def content(self) -> np.ndarray:
70
+ """Return the bin contents.
71
+ """
72
+ return self._sumw
73
+
74
+ @property
75
+ def errors(self) -> np.ndarray:
76
+ """Return the bin errors.
77
+ """
78
+ return np.sqrt(self._sumw2)
79
+
80
+ def bin_edges(self, axis: int = 0) -> np.ndarray:
81
+ """Return a view on the binning for specific axis.
82
+ """
83
+ return self._edges[axis].view()
84
+
85
+ def bin_centers(self, axis: int = 0) -> np.ndarray:
86
+ """Return the bin centers for a specific axis.
87
+ """
88
+ return 0.5 * (self._edges[axis][1:] + self._edges[axis][:-1])
89
+
90
+ def bin_widths(self, axis: int = 0) -> np.ndarray:
91
+ """Return the bin widths for a specific axis.
92
+ """
93
+ return np.diff(self._edges[axis])
94
+
95
+ def fill(self, *values: ArrayLike, weights: ArrayLike = None) -> "AbstractHistogram":
96
+ """Fill the histogram from unbinned data.
97
+
98
+ Note this method is returning the histogram instance, so that the function
99
+ call can be chained.
100
+ """
101
+ values = np.vstack(values).T
102
+ sumw, _ = np.histogramdd(values, bins=self._edges, weights=weights)
103
+ if weights is None:
104
+ sumw2 = sumw
105
+ else:
106
+ sumw2, _ = np.histogramdd(values, bins=self._edges, weights=weights**2.)
107
+ self._sumw += sumw
108
+ self._sumw2 += sumw2
109
+ return self
110
+
111
+ def copy(self) -> "AbstractHistogram":
112
+ """Create a full copy of a histogram.
113
+ """
114
+ # pylint: disable=protected-access
115
+ # Note we really need the * in the constructor, here, as the abstract
116
+ # base class is never instantiated, and the arguments are unpacked in the
117
+ # constructors of all the derived classes.
118
+ histogram = self.__class__(*self._edges, *self._labels)
119
+ histogram._sumw = self._sumw.copy()
120
+ histogram._sumw2 = self._sumw2.copy()
121
+ return histogram
122
+
123
+ def _check_compat(self, other: "AbstractHistogram") -> None:
124
+ """Check whether two histogram objects are compatible with each other,
125
+ meaning, e.g., that they can be summed or subtracted.
126
+ """
127
+ # pylint: disable=protected-access
128
+ if not isinstance(other, AbstractHistogram):
129
+ raise TypeError(f"{other} is not a histogram.")
130
+ if self._num_axes != other._num_axes or self._shape != other._shape:
131
+ raise ValueError("Histogram dimensionality/shape mismatch.")
132
+ for edges in zip(self._edges, other._edges):
133
+ if not np.allclose(*edges):
134
+ raise ValueError("Histogram bin edges differ.")
135
+
136
+ def __iadd__(self, other: "AbstractHistogram") -> "AbstractHistogram":
137
+ """Histogram addition (in place).
138
+ """
139
+ self._check_compat(other)
140
+ self._sumw += other._sumw
141
+ self._sumw2 += other._sumw2
142
+ return self
143
+
144
+ def __add__(self, other: "AbstractHistogram") -> "AbstractHistogram":
145
+ """Histogram addition.
146
+ """
147
+ histogram = self.copy()
148
+ histogram += other
149
+ return histogram
150
+
151
+ def __isub__(self, other: "AbstractHistogram") -> "AbstractHistogram":
152
+ """Histogram subtraction (in place).
153
+ """
154
+ self._check_compat(other)
155
+ self._sumw -= other._sumw
156
+ self._sumw2 += other._sumw2
157
+ return self
158
+
159
+ def __sub__(self, other: "AbstractHistogram") -> "AbstractHistogram":
160
+ """Histogram subtraction.
161
+ """
162
+ histogram = self.copy()
163
+ histogram -= other
164
+ return histogram
165
+
166
+ @abstractmethod
167
+ def _do_plot(self, axes, **kwargs) -> None:
168
+ pass
169
+
170
+ def plot(self, axes=None, **kwargs) -> None:
171
+ """Plot the histogram.
172
+ """
173
+ if axes is None:
174
+ axes = plt.gca()
175
+ for key, value in self.DEFAULT_PLOT_OPTIONS.items():
176
+ kwargs.setdefault(key, value)
177
+ self._do_plot(axes, **kwargs)
178
+
179
+ def __repr__(self) -> str:
180
+ """String representation of the histogram.
181
+ """
182
+ return f"{self.__class__.__name__}({self._num_axes} axes, shape={self._shape})"
183
+
184
+
185
+ class Histogram1d(AbstractHistogram):
186
+
187
+ """One-dimensional histogram.
188
+ """
189
+
190
+ DEFAULT_PLOT_OPTIONS = dict(linewidth=1.25, alpha=0.4, histtype="stepfilled")
191
+
192
+ def __init__(self, xedges: np.ndarray, xlabel: str = "", ylabel: str = "Entries/bin") -> None:
193
+ """Constructor.
194
+ """
195
+ super().__init__((xedges, ), [xlabel, ylabel])
196
+
197
+ def _do_plot(self, axes: matplotlib.axes._axes.Axes, **kwargs) -> None:
198
+ """Overloaded make_plot() method.
199
+ """
200
+ axes.hist(self.bin_centers(0), self._edges[0], weights=self.content, **kwargs)
201
+ setup_axes(axes, xlabel=self._labels[0], ylabel=self._labels[1])
202
+
203
+
204
+ class Histogram2d(AbstractHistogram):
205
+
206
+ """Two-dimensional histogram.
207
+ """
208
+
209
+ DEFAULT_PLOT_OPTIONS = dict(cmap=plt.get_cmap('hot'))
210
+
211
+ def __init__(self, xedges, yedges, xlabel='', ylabel='', zlabel='Entries/bin') -> None:
212
+ """Constructor.
213
+ """
214
+ super().__init__((xedges, yedges), [xlabel, ylabel, zlabel])
215
+
216
+ def _do_plot(self, axes: matplotlib.axes._axes.Axes, logz: bool = False, **kwargs) -> None:
217
+ """Overloaded make_plot() method.
218
+ """
219
+ # pylint: disable=arguments-differ
220
+ if logz:
221
+ vmin = kwargs.pop('vmin', None)
222
+ vmax = kwargs.pop('vmax', None)
223
+ kwargs.setdefault('norm', matplotlib.colors.LogNorm(vmin, vmax))
224
+ mappable = axes.pcolormesh(*self._edges, self.content.T, **kwargs)
225
+ plt.colorbar(mappable, ax=axes, label=self._labels[2])
226
+ setup_axes(axes, xlabel=self._labels[0], ylabel=self._labels[1])
aptapy/modeling.py CHANGED
@@ -37,11 +37,11 @@ class Format(str, enum.Enum):
37
37
  """Small enum class to control string formatting.
38
38
 
39
39
  This is leveraging the custom formatting of the uncertainties package, where
40
- a trailing 'P' means "pretty print" and a trailing "L" means LaTeX.
40
+ a trailing `P` means "pretty print" and a trailing `L` means "LaTeX".
41
41
  """
42
42
 
43
- PRETTY = 'P'
44
- LATEX = 'L'
43
+ PRETTY = "P"
44
+ LATEX = "L"
45
45
 
46
46
 
47
47
  @dataclass
@@ -80,7 +80,7 @@ class FitParameter:
80
80
  """
81
81
  return not np.isinf(self.minimum) or not np.isinf(self.maximum)
82
82
 
83
- def copy(self, name: str) -> 'FitParameter':
83
+ def copy(self, name: str) -> "FitParameter":
84
84
  """Create a copy of the parameter object with a new name.
85
85
 
86
86
  This is necessary because we define the fit parameters of the actual model as
@@ -139,24 +139,24 @@ class FitParameter:
139
139
  """String formatting.
140
140
  """
141
141
  # Keep in mind Python passes an empty string explicitly when you call
142
- # f'{parameter}', so we can't really assign a default value to spec.
142
+ # f"{parameter}", so we can't really assign a default value to spec.
143
143
  if self.error is not None:
144
144
  param = format(self.ufloat(), spec)
145
145
  if spec.endswith(Format.LATEX):
146
- param = f'${param}$'
146
+ param = f"${param}$"
147
147
  else:
148
148
  spec = spec.rstrip(Format.PRETTY).rstrip(Format.LATEX)
149
149
  param = format(self.value, spec)
150
- text = f'{self._name.title()}: {param}'
150
+ text = f"{self._name.title()}: {param}"
151
151
  info = []
152
152
  if self._frozen:
153
- info.append('frozen')
153
+ info.append("frozen")
154
154
  if not np.isinf(self.minimum):
155
- info.append(f'min={self.minimum}')
155
+ info.append(f"min={self.minimum}")
156
156
  if not np.isinf(self.maximum):
157
- info.append(f'max={self.maximum}')
157
+ info.append(f"max={self.maximum}")
158
158
  if info:
159
- text = f'{text} ({", ".join(info)})'
159
+ text = f"{text} ({', '.join(info)})"
160
160
  return text
161
161
 
162
162
  def __str__(self) -> str:
@@ -191,12 +191,12 @@ class FitStatus:
191
191
  """String formatting.
192
192
  """
193
193
  if self.chisquare is None:
194
- return 'N/A'
194
+ return "N/A"
195
195
  if spec.endswith(Format.LATEX):
196
- return f'$\\chi^2$ = {self.chisquare:.2f} / {self.dof} dof'
196
+ return f"$\\chi^2$ = {self.chisquare:.2f} / {self.dof} dof"
197
197
  if spec.endswith(Format.PRETTY):
198
- return f'χ² = {self.chisquare:.2f} / {self.dof} dof'
199
- return f'chisquare = {self.chisquare:.2f} / {self.dof} dof'
198
+ return f"χ² = {self.chisquare:.2f} / {self.dof} dof"
199
+ return f"chisquare = {self.chisquare:.2f} / {self.dof} dof"
200
200
 
201
201
  def __str__(self) -> str:
202
202
  """String formatting.
@@ -337,7 +337,7 @@ class AbstractFitModel(ABC):
337
337
  # print out an error message.
338
338
  unknown_parameter_names = set(constraints) - set(parameter_names)
339
339
  if unknown_parameter_names:
340
- raise ValueError(f'Cannot freeze unknown parameters {unknown_parameter_names}')
340
+ raise ValueError(f"Cannot freeze unknown parameters {unknown_parameter_names}")
341
341
 
342
342
  # Now we need to build the signature for the new function, starting from a
343
343
  # clean copy of the parameter for the independent variable...
@@ -353,8 +353,8 @@ class AbstractFitModel(ABC):
353
353
  @functools.wraps(model_function)
354
354
  def wrapper(x, *args):
355
355
  if len(args) != num_free_parameters:
356
- raise TypeError(f'Frozen wrapper got {len(args)} parameters instead of ' \
357
- f'{num_free_parameters} ({free_parameter_names})')
356
+ raise TypeError(f"Frozen wrapper got {len(args)} parameters instead of " \
357
+ f"{num_free_parameters} ({free_parameter_names})")
358
358
  parameter_dict = {**dict(zip(free_parameter_names, args)), **constraints}
359
359
  return model_function(x, *[parameter_dict[name] for name in parameter_names])
360
360
 
@@ -379,7 +379,7 @@ class AbstractFitModel(ABC):
379
379
  # (And, since we are at it, make sure we have enough degrees of freedom.)
380
380
  self.status.dof = int(mask.sum() - len(self))
381
381
  if self.status.dof < 0:
382
- raise RuntimeError(f'{self.name()} has no degrees of freedom')
382
+ raise RuntimeError(f"{self.name()} has no degrees of freedom")
383
383
  xdata = xdata[mask]
384
384
  ydata = ydata[mask]
385
385
  if not isinstance(sigma, Number):
@@ -444,10 +444,10 @@ class AbstractFitModel(ABC):
444
444
  def __format__(self, spec: str) -> str:
445
445
  """String formatting.
446
446
  """
447
- text = f'{self.__class__.__name__} ({format(self.status, spec)})\n'
447
+ text = f"{self.__class__.__name__} ({format(self.status, spec)})\n"
448
448
  for parameter in self._parameters:
449
- text = f'{text}{format(parameter, spec)}\n'
450
- return text.strip('\n')
449
+ text = f"{text}{format(parameter, spec)}\n"
450
+ return text.strip("\n")
451
451
 
452
452
  def __str__(self):
453
453
  """String formatting.
aptapy/plotting.py CHANGED
@@ -27,11 +27,48 @@ DEFAULT_FIGURE_WIDTH = 8.
27
27
  DEFAULT_FIGURE_HEIGHT = 6.
28
28
  DEFAULT_FIGURE_SIZE = (DEFAULT_FIGURE_WIDTH, DEFAULT_FIGURE_HEIGHT)
29
29
  DEFAULT_COLOR_CYCLE = [
30
- '#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b',
31
- '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'
30
+ "#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "#8c564b",
31
+ "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"
32
32
  ]
33
33
 
34
34
 
35
+ def setup_axes(axes, **kwargs):
36
+ """Setup a generic axes object.
37
+ """
38
+ if kwargs.get('logx'):
39
+ axes.set_xscale('log')
40
+ if kwargs.get('logy'):
41
+ axes.set_yscale('log')
42
+ xticks = kwargs.get('xticks')
43
+ if xticks is not None:
44
+ axes.set_xticks(xticks)
45
+ yticks = kwargs.get('yticks')
46
+ if yticks is not None:
47
+ axes.set_yticks(yticks)
48
+ xlabel = kwargs.get('xlabel')
49
+ if xlabel is not None:
50
+ axes.set_xlabel(xlabel)
51
+ ylabel = kwargs.get('ylabel')
52
+ if ylabel is not None:
53
+ axes.set_ylabel(ylabel)
54
+ xmin, xmax, ymin, ymax = [kwargs.get(key) for key in ('xmin', 'xmax', 'ymin', 'ymax')]
55
+ # Set axis limits individually to avoid passing None to axes.axis()
56
+ if xmin is not None or xmax is not None:
57
+ axes.set_xlim(left=xmin, right=xmax)
58
+ if ymin is not None or ymax is not None:
59
+ axes.set_ylim(bottom=ymin, top=ymax)
60
+ if kwargs.get('grids'):
61
+ axes.grid(which='both')
62
+ if kwargs.get('legend'):
63
+ axes.legend()
64
+
65
+
66
+ def setup_gca(**kwargs):
67
+ """Setup the axes for the current plot.
68
+ """
69
+ setup_axes(plt.gca(), **kwargs)
70
+
71
+
35
72
  def _set(key: str, value: Any):
36
73
  """Set the value for a single matplotlib parameter.
37
74
 
@@ -42,9 +79,9 @@ def _set(key: str, value: Any):
42
79
  try:
43
80
  matplotlib.rcParams[key] = value
44
81
  except KeyError:
45
- logger.warning(f'Unknown matplotlib rc param {key}, skipping...')
82
+ logger.warning(f"Unknown matplotlib rc param {key}, skipping...")
46
83
  except ValueError as exception:
47
- logger.warning(f'{exception}, skipping...')
84
+ logger.warning(f"{exception}, skipping...")
48
85
 
49
86
 
50
87
  def configure() -> None:
@@ -54,433 +91,433 @@ def configure() -> None:
54
91
  # pylint:disable=too-many-statements
55
92
 
56
93
  # Backends
57
- _set('interactive', False)
58
- _set('timezone', 'UTC')
94
+ _set("interactive", False)
95
+ _set("timezone", "UTC")
59
96
 
60
97
  # Lines
61
98
  # See https://matplotlib.org/stable/api/artist_api.html#module-matplotlib.lines
62
- _set('lines.linewidth', 1.5) # line width in points
63
- _set('lines.linestyle', '-') # solid line
64
- _set('lines.color', 'C0') # has no affect on plot(); see axes.prop_cycle
65
- _set('lines.marker', 'None') # the default marker
66
- _set('lines.markerfacecolor', 'auto') # the default marker face color
67
- _set('lines.markeredgecolor', 'auto') # the default marker edge color
68
- _set('lines.markeredgewidth', 1.0) # the line width around the marker symbol
69
- _set('lines.markersize', 6) # marker size, in points
70
- _set('lines.dash_joinstyle', 'round') # {miter, round, bevel}
71
- _set('lines.dash_capstyle', 'butt') # {butt, round, projecting}
72
- _set('lines.solid_joinstyle', 'round') # {miter, round, bevel}
73
- _set('lines.solid_capstyle', 'projecting') # {butt, round, projecting}
74
- _set('lines.antialiased', True) # render lines in antialiased (no jaggies)
99
+ _set("lines.linewidth", 1.5) # line width in points
100
+ _set("lines.linestyle", "-") # solid line
101
+ _set("lines.color", "C0") # has no affect on plot(); see axes.prop_cycle
102
+ _set("lines.marker", "None") # the default marker
103
+ _set("lines.markerfacecolor", "auto") # the default marker face color
104
+ _set("lines.markeredgecolor", "auto") # the default marker edge color
105
+ _set("lines.markeredgewidth", 1.0) # the line width around the marker symbol
106
+ _set("lines.markersize", 6) # marker size, in points
107
+ _set("lines.dash_joinstyle", "round") # {miter, round, bevel}
108
+ _set("lines.dash_capstyle", "butt") # {butt, round, projecting}
109
+ _set("lines.solid_joinstyle", "round") # {miter, round, bevel}
110
+ _set("lines.solid_capstyle", "projecting") # {butt, round, projecting}
111
+ _set("lines.antialiased", True) # render lines in antialiased (no jaggies)
75
112
  # The three standard dash patterns. These are scaled by the linewidth.
76
- _set('lines.dashed_pattern', (3.7, 1.6))
77
- _set('lines.dashdot_pattern', (6.4, 1.6, 1, 1.6))
78
- _set('lines.dotted_pattern', (1, 1.65))
79
- _set('lines.scale_dashes', True)
80
- _set('markers.fillstyle', 'full') # {full, left, right, bottom, top, none}
81
- _set('pcolor.shading', 'auto')
113
+ _set("lines.dashed_pattern", (3.7, 1.6))
114
+ _set("lines.dashdot_pattern", (6.4, 1.6, 1, 1.6))
115
+ _set("lines.dotted_pattern", (1, 1.65))
116
+ _set("lines.scale_dashes", True)
117
+ _set("markers.fillstyle", "full") # {full, left, right, bottom, top, none}
118
+ _set("pcolor.shading", "auto")
82
119
  # Whether to snap the mesh to pixel boundaries. This is provided solely to allow
83
120
  # old test images to remain unchanged. Set to False to obtain the previous behavior.
84
- _set('pcolormesh.snap', True)
121
+ _set("pcolormesh.snap", True)
85
122
 
86
123
  # Patches are graphical objects that fill 2D space, like polygons or circles.
87
124
  # See https://matplotlib.org/stable/api/artist_api.html#module-matplotlib.patches
88
- _set('patch.linewidth', 1.0) # edge width in points.
89
- _set('patch.facecolor', 'C0')
125
+ _set("patch.linewidth", 1.0) # edge width in points.
126
+ _set("patch.facecolor", "C0")
90
127
  # By default, Patches and Collections do not draw edges. This value is only used
91
128
  # if facecolor is "none" (an Artist without facecolor and edgecolor would be
92
129
  # invisible) or if patch.force_edgecolor is True.
93
- _set('patch.edgecolor', 'black')
130
+ _set("patch.edgecolor", "black")
94
131
  # By default, Patches and Collections do not draw edges. Set this to True to draw
95
132
  # edges with patch.edgedcolor as the default edgecolor. This is mainly relevant
96
133
  # for styles.
97
- _set('patch.force_edgecolor', False)
98
- _set('patch.antialiased', True) # render patches in antialiased (no jaggies)
134
+ _set("patch.force_edgecolor", True)
135
+ _set("patch.antialiased", True) # render patches in antialiased (no jaggies)
99
136
 
100
137
  # Hatches
101
- _set('hatch.color', 'black')
102
- _set('hatch.linewidth', 1.0)
103
-
104
- # Boxplot---we don't really use these much, but you never know...
105
- _set('boxplot.notch', False)
106
- _set('boxplot.vertical', True)
107
- _set('boxplot.whiskers', 1.5)
108
- _set('boxplot.bootstrap', None)
109
- _set('boxplot.patchartist', False)
110
- _set('boxplot.showmeans', False)
111
- _set('boxplot.showcaps', True)
112
- _set('boxplot.showbox', True)
113
- _set('boxplot.showfliers', True)
114
- _set('boxplot.meanline', False)
115
- _set('boxplot.flierprops.color', 'black')
116
- _set('boxplot.flierprops.marker', 'o')
117
- _set('boxplot.flierprops.markerfacecolor', 'none')
118
- _set('boxplot.flierprops.markeredgecolor', 'black')
119
- _set('boxplot.flierprops.markeredgewidth', 1.0)
120
- _set('boxplot.flierprops.markersize', 6)
121
- _set('boxplot.flierprops.linestyle', 'none')
122
- _set('boxplot.flierprops.linewidth', 1.0)
123
- _set('boxplot.boxprops.color', 'black')
124
- _set('boxplot.boxprops.linewidth', 1.0)
125
- _set('boxplot.boxprops.linestyle', '-')
126
- _set('boxplot.whiskerprops.color', 'black')
127
- _set('boxplot.whiskerprops.linewidth', 1.0)
128
- _set('boxplot.whiskerprops.linestyle', '-')
129
- _set('boxplot.capprops.color', 'black')
130
- _set('boxplot.capprops.linewidth', 1.0)
131
- _set('boxplot.capprops.linestyle', '-')
132
- _set('boxplot.medianprops.color', 'C1')
133
- _set('boxplot.medianprops.linewidth', 1.0)
134
- _set('boxplot.medianprops.linestyle', '-')
135
- _set('boxplot.meanprops.color', 'C2')
136
- _set('boxplot.meanprops.marker', '^')
137
- _set('boxplot.meanprops.markerfacecolor', 'C2')
138
- _set('boxplot.meanprops.markeredgecolor', 'C2')
139
- _set('boxplot.meanprops.markersize', 6)
140
- _set('boxplot.meanprops.linestyle', '--')
141
- _set('boxplot.meanprops.linewidth', 1.0)
138
+ _set("hatch.color", "black")
139
+ _set("hatch.linewidth", 1.0)
140
+
141
+ # Boxplot---we don"t really use these much, but you never know...
142
+ _set("boxplot.notch", False)
143
+ _set("boxplot.vertical", True)
144
+ _set("boxplot.whiskers", 1.5)
145
+ _set("boxplot.bootstrap", None)
146
+ _set("boxplot.patchartist", False)
147
+ _set("boxplot.showmeans", False)
148
+ _set("boxplot.showcaps", True)
149
+ _set("boxplot.showbox", True)
150
+ _set("boxplot.showfliers", True)
151
+ _set("boxplot.meanline", False)
152
+ _set("boxplot.flierprops.color", "black")
153
+ _set("boxplot.flierprops.marker", "o")
154
+ _set("boxplot.flierprops.markerfacecolor", "none")
155
+ _set("boxplot.flierprops.markeredgecolor", "black")
156
+ _set("boxplot.flierprops.markeredgewidth", 1.0)
157
+ _set("boxplot.flierprops.markersize", 6)
158
+ _set("boxplot.flierprops.linestyle", "none")
159
+ _set("boxplot.flierprops.linewidth", 1.0)
160
+ _set("boxplot.boxprops.color", "black")
161
+ _set("boxplot.boxprops.linewidth", 1.0)
162
+ _set("boxplot.boxprops.linestyle", "-")
163
+ _set("boxplot.whiskerprops.color", "black")
164
+ _set("boxplot.whiskerprops.linewidth", 1.0)
165
+ _set("boxplot.whiskerprops.linestyle", "-")
166
+ _set("boxplot.capprops.color", "black")
167
+ _set("boxplot.capprops.linewidth", 1.0)
168
+ _set("boxplot.capprops.linestyle", "-")
169
+ _set("boxplot.medianprops.color", "C1")
170
+ _set("boxplot.medianprops.linewidth", 1.0)
171
+ _set("boxplot.medianprops.linestyle", "-")
172
+ _set("boxplot.meanprops.color", "C2")
173
+ _set("boxplot.meanprops.marker", "^")
174
+ _set("boxplot.meanprops.markerfacecolor", "C2")
175
+ _set("boxplot.meanprops.markeredgecolor", "C2")
176
+ _set("boxplot.meanprops.markersize", 6)
177
+ _set("boxplot.meanprops.linestyle", "--")
178
+ _set("boxplot.meanprops.linewidth", 1.0)
142
179
 
143
180
  # The font properties used by `text.Text`.
144
181
  # See https://matplotlib.org/stable/api/font_manager_api.html
145
182
  # Note that for font.serif, font.sans-serif, and font.monospace, the first element
146
183
  # of the list (a DejaVu font) will always be used because DejaVu is shipped with
147
184
  # Matplotlib and is thus guaranteed to be available.
148
- _set('font.family', 'sans-serif')
149
- _set('font.style', 'normal') # {normal (or roman), italic, oblique}
150
- _set('font.variant', 'normal') # {normal, small-caps}
185
+ _set("font.family", "sans-serif")
186
+ _set("font.style", "normal") # {normal (or roman), italic, oblique}
187
+ _set("font.variant", "normal") # {normal, small-caps}
151
188
  # The font.weight property has effectively 13 values: normal, bold, bolder, lighter,
152
189
  # 100, 200, 300, ..., 900. Normal is the same as 400, and bold is 700. bolder and
153
190
  # lighter are relative values with respect to the current weight.
154
- _set('font.weight', 'normal')
155
- _set('font.stretch', 'normal') # Currently not implemented.
191
+ _set("font.weight", "normal")
192
+ _set("font.stretch", "normal") # Currently not implemented.
156
193
  # The font.size property is the default font size for text, given in points. 10 pt
157
194
  # is the standard value. Special text sizes can be defined relative to font.size,
158
195
  # using the following values: xx-small, x-small, small, medium, large, x-large,
159
196
  # xx-large, larger, or smaller
160
- _set('font.size', 14.0)
197
+ _set("font.size", 14.0)
161
198
 
162
199
  ## The text properties used by `text.Text`.
163
200
  ## See https://matplotlib.org/stable/api/artist_api.html#module-matplotlib.text
164
- _set('text.color', 'black')
201
+ _set("text.color", "black")
165
202
  # FreeType hinting flag {default, no_autohint, force_autohint, no_hinting}
166
- _set('text.hinting', 'force_autohint')
203
+ _set("text.hinting", "force_autohint")
167
204
  # Specifies the amount of softness for hinting in the horizontal direction.
168
205
  # A value of 1 will hint to full pixels. A value of 2 will hint to half pixels etc.
169
- _set('text.hinting_factor', 8)
206
+ _set("text.hinting_factor", 8)
170
207
  # Specifies the scaling factor for kerning values. This is provided solely to
171
208
  # allow old test images to remain unchanged. Set to 6 to obtain previous behavior.
172
209
  # Values other than 0 or 6 have no defined meaning.
173
- _set('text.kerning_factor', 0)
174
- _set('text.antialiased', True) # This only affects raster outputs.
210
+ _set("text.kerning_factor", 0)
211
+ _set("text.antialiased", True) # This only affects raster outputs.
175
212
  # Use mathtext if there is an even number of unescaped dollar signs.
176
- _set('text.parse_math', True)
213
+ _set("text.parse_math", True)
177
214
 
178
215
  # LaTeX
179
216
  # See https://matplotlib.org/stable/users/explain/text/usetex.html
180
- _set('text.usetex', False) # use latex for all text handling.
217
+ _set("text.usetex", False) # use latex for all text handling.
181
218
  # Font set can be {dejavusans, dejavuserif, cm, stixsans, custom}, where
182
219
  # "custom" is defined by the mathtext.bf, .cal, .it, ..., settings which map
183
220
  # a TeX font name to a fontconfig font pattern.
184
- _set('mathtext.fontset', 'dejavusans')
185
- _set('mathtext.fallback', 'cm')
186
- _set('mathtext.default', 'it')
221
+ _set("mathtext.fontset", "dejavusans")
222
+ _set("mathtext.fallback", "cm")
223
+ _set("mathtext.default", "it")
187
224
 
188
225
  # Axes
189
226
  # See https://matplotlib.org/stable/api/axes_api.html#module-matplotlib.axes
190
- _set('axes.facecolor', 'white') # axes background color
191
- _set('axes.edgecolor', 'black') # axes edge color
192
- _set('axes.linewidth', 1.2) # edge line width
193
- _set('axes.grid', True) # display grid or not
194
- _set('axes.grid.axis', 'both') # which axis the grid should apply to
195
- _set('axes.grid.which', 'major') # grid lines at {major, minor, both} ticks
196
- _set('axes.titlelocation', 'center') # alignment of the title: {left, right, center}
197
- _set('axes.titlesize', 'large') # font size of the axes title
198
- _set('axes.titleweight', 'normal') # font weight of title
227
+ _set("axes.facecolor", "white") # axes background color
228
+ _set("axes.edgecolor", "black") # axes edge color
229
+ _set("axes.linewidth", 1.2) # edge line width
230
+ _set("axes.grid", True) # display grid or not
231
+ _set("axes.grid.axis", "both") # which axis the grid should apply to
232
+ _set("axes.grid.which", "major") # grid lines at {major, minor, both} ticks
233
+ _set("axes.titlelocation", "center") # alignment of the title: {left, right, center}
234
+ _set("axes.titlesize", "large") # font size of the axes title
235
+ _set("axes.titleweight", "normal") # font weight of title
199
236
  # Color of the axes title, auto falls back tO text.color as default value
200
- _set('axes.titlecolor', 'auto')
201
- _set('axes.titley', None) # position title (axes relative units). None implies auto
202
- _set('axes.titlepad', 6.0) # pad between axes and title in points
203
- _set('axes.labelsize', 'medium') # font size of the x and y labels
204
- _set('axes.labelpad', 4.0) # space between label and axis
205
- _set('axes.labelweight', 'normal') # weight of the x and y labels
206
- _set('axes.labelcolor', 'black')
237
+ _set("axes.titlecolor", "auto")
238
+ _set("axes.titley", None) # position title (axes relative units). None implies auto
239
+ _set("axes.titlepad", 6.0) # pad between axes and title in points
240
+ _set("axes.labelsize", "medium") # font size of the x and y labels
241
+ _set("axes.labelpad", 4.0) # space between label and axis
242
+ _set("axes.labelweight", "normal") # weight of the x and y labels
243
+ _set("axes.labelcolor", "black")
207
244
  # Draw axis gridlines and ticks:
208
245
  # - below patches (True)
209
- # - above patches but below lines ('line')
246
+ # - above patches but below lines ("line")
210
247
  # - above all (False)
211
- _set('axes.axisbelow', 'line')
248
+ _set("axes.axisbelow", "line")
212
249
  # Use scientific notation if log10 of the axis range is smaller than the
213
250
  # first or larger than the second
214
- _set('axes.formatter.limits', (-5, 6))
215
- _set('axes.formatter.use_locale', False)
251
+ _set("axes.formatter.limits", (-5, 6))
252
+ _set("axes.formatter.use_locale", False)
216
253
  # When True, use mathtext for scientific notation.
217
- _set('axes.formatter.use_mathtext', False)
254
+ _set("axes.formatter.use_mathtext", False)
218
255
  # Minimum exponent to format in scientific notation
219
- _set('axes.formatter.min_exponent', 0)
256
+ _set("axes.formatter.min_exponent", 0)
220
257
  # If True, the tick label formatter will default to labeling ticks relative
221
258
  # to an offset when the data range is small compared to the minimum absolute
222
259
  # value of the data.
223
- _set('axes.formatter.useoffset', True)
260
+ _set("axes.formatter.useoffset", True)
224
261
  # When useoffset is True, the offset will be used when it can remove
225
262
  # at least this number of significant digits from tick labels.
226
- _set('axes.formatter.offset_threshold', 4)
227
- _set('axes.spines.left', True) # display axis spines
228
- _set('axes.spines.bottom', True)
229
- _set('axes.spines.top', True)
230
- _set('axes.spines.right', True)
263
+ _set("axes.formatter.offset_threshold", 4)
264
+ _set("axes.spines.left", True) # display axis spines
265
+ _set("axes.spines.bottom", True)
266
+ _set("axes.spines.top", True)
267
+ _set("axes.spines.right", True)
231
268
  # use Unicode for the minus symbol rather than hyphen. See
232
269
  # https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes
233
- _set('axes.unicode_minus', True)
234
- _set('axes.prop_cycle', cycler('color', DEFAULT_COLOR_CYCLE))
235
- _set('axes.xmargin', .05) # x margin. See `axes.Axes.margins`
236
- _set('axes.ymargin', .05) # y margin. See `axes.Axes.margins`
237
- _set('axes.zmargin', .05) # z margin. See `axes.Axes.margins`
270
+ _set("axes.unicode_minus", True)
271
+ _set("axes.prop_cycle", cycler("color", DEFAULT_COLOR_CYCLE))
272
+ _set("axes.xmargin", .05) # x margin. See `axes.Axes.margins`
273
+ _set("axes.ymargin", .05) # y margin. See `axes.Axes.margins`
274
+ _set("axes.zmargin", .05) # z margin. See `axes.Axes.margins`
238
275
  # If "data", use axes.xmargin and axes.ymargin as is.
239
276
  # If "round_numbers", after application of margins, axis limits are further expanded
240
277
  # to the nearest "round" number.
241
- _set('axes.autolimit_mode', 'data')
242
- _set('polaraxes.grid', True) # display grid on polar axes
243
- _set('axes3d.grid', True) # display grid on 3D axes
278
+ _set("axes.autolimit_mode", "data")
279
+ _set("polaraxes.grid", True) # display grid on polar axes
280
+ _set("axes3d.grid", True) # display grid on 3D axes
244
281
  # Automatically add margin when manually setting 3D axis limits
245
- _set('axes3d.automargin', False)
246
- _set('axes3d.xaxis.panecolor', (0.95, 0.95, 0.95, 0.5)) # background pane on 3D axes
247
- _set('axes3d.yaxis.panecolor', (0.90, 0.90, 0.90, 0.5)) # background pane on 3D axes
248
- _set('axes3d.zaxis.panecolor', (0.925, 0.925, 0.925, 0.5)) # background pane on 3D axes
249
- _set('axes3d.mouserotationstyle', 'arcball') # {azel, trackball, sphere, arcball}
250
- _set('axes3d.trackballsize', 0.667) # trackball diameter, in units of the Axes bbox
251
- # trackball border width, in units of the Axes bbox (only for 'sphere' and 'arcball' style)
252
- _set('axes3d.trackballborder', 0.2)
282
+ _set("axes3d.automargin", False)
283
+ _set("axes3d.xaxis.panecolor", (0.95, 0.95, 0.95, 0.5)) # background pane on 3D axes
284
+ _set("axes3d.yaxis.panecolor", (0.90, 0.90, 0.90, 0.5)) # background pane on 3D axes
285
+ _set("axes3d.zaxis.panecolor", (0.925, 0.925, 0.925, 0.5)) # background pane on 3D axes
286
+ _set("axes3d.mouserotationstyle", "arcball") # {azel, trackball, sphere, arcball}
287
+ _set("axes3d.trackballsize", 0.667) # trackball diameter, in units of the Axes bbox
288
+ # trackball border width, in units of the Axes bbox (only for "sphere" and "arcball" style)
289
+ _set("axes3d.trackballborder", 0.2)
253
290
 
254
291
  # Axis
255
- _set('xaxis.labellocation', 'center') # {left, right, center}
256
- _set('yaxis.labellocation', 'center') # {bottom, top, center}
292
+ _set("xaxis.labellocation", "center") # {left, right, center}
293
+ _set("yaxis.labellocation", "center") # {bottom, top, center}
257
294
 
258
295
  # Dates
259
296
  # These control the default format strings used in AutoDateFormatter.
260
- _set('date.autoformatter.year', '%Y')
261
- _set('date.autoformatter.month', '%Y-%m')
262
- _set('date.autoformatter.day', '%Y-%m-%d')
263
- _set('date.autoformatter.hour', '%m-%d %H')
264
- _set('date.autoformatter.minute', '%d %H:%M')
265
- _set('date.autoformatter.second', '%H:%M:%S')
266
- _set('date.autoformatter.microsecond', '%M:%S.%f')
267
- # The reference date for Matplotlib's internal date representation
297
+ _set("date.autoformatter.year", "%Y")
298
+ _set("date.autoformatter.month", "%Y-%m")
299
+ _set("date.autoformatter.day", "%Y-%m-%d")
300
+ _set("date.autoformatter.hour", "%m-%d %H")
301
+ _set("date.autoformatter.minute", "%d %H:%M")
302
+ _set("date.autoformatter.second", "%H:%M:%S")
303
+ _set("date.autoformatter.microsecond", "%M:%S.%f")
304
+ # The reference date for Matplotlib"s internal date representation
268
305
  # See https://matplotlib.org/stable/gallery/ticks/date_precision_and_epochs.html
269
- _set('date.epoch', '1970-01-01T00:00:00')
270
- _set('date.converter', 'auto') # {auto, concise}
306
+ _set("date.epoch", "1970-01-01T00:00:00")
307
+ _set("date.converter", "auto") # {auto, concise}
271
308
  # For auto converter whether to use interval_multiples:
272
- _set('date.interval_multiples', True)
309
+ _set("date.interval_multiples", True)
273
310
 
274
311
  # Ticks
275
312
  # See https://matplotlib.org/stable/api/axis_api.html#matplotlib.axis.Tick
276
- _set('xtick.top', False) # draw ticks on the top side
277
- _set('xtick.bottom', True) # draw ticks on the bottom side
278
- _set('xtick.labeltop', False) # draw label on the top
279
- _set('xtick.labelbottom', True) # draw label on the bottom
280
- _set('xtick.major.size', 3.5) # major tick size in points
281
- _set('xtick.minor.size', 2) # minor tick size in points
282
- _set('xtick.major.width', 0.8) # major tick width in points
283
- _set('xtick.minor.width', 0.6) # minor tick width in points
284
- _set('xtick.major.pad', 3.5) # distance to major tick label in points
285
- _set('xtick.minor.pad', 3.4) # distance to the minor tick label in points
286
- _set('xtick.color', 'black') # color of the ticks
313
+ _set("xtick.top", False) # draw ticks on the top side
314
+ _set("xtick.bottom", True) # draw ticks on the bottom side
315
+ _set("xtick.labeltop", False) # draw label on the top
316
+ _set("xtick.labelbottom", True) # draw label on the bottom
317
+ _set("xtick.major.size", 3.5) # major tick size in points
318
+ _set("xtick.minor.size", 2) # minor tick size in points
319
+ _set("xtick.major.width", 0.8) # major tick width in points
320
+ _set("xtick.minor.width", 0.6) # minor tick width in points
321
+ _set("xtick.major.pad", 3.5) # distance to major tick label in points
322
+ _set("xtick.minor.pad", 3.4) # distance to the minor tick label in points
323
+ _set("xtick.color", "black") # color of the ticks
287
324
  # Color of the tick labels or inherit from xtick.color
288
- _set('xtick.labelcolor', 'inherit')
289
- _set('xtick.labelsize', 'medium') # font size of the tick labels
290
- _set('xtick.direction', 'out') # direction: {in, out, inout}
291
- _set('xtick.minor.visible', False) # visibility of minor ticks on x-axis
292
- _set('xtick.major.top', True) # draw x axis top major ticks
293
- _set('xtick.major.bottom', True) # draw x axis bottom major ticks
294
- _set('xtick.minor.top', True) # draw x axis top minor ticks
295
- _set('xtick.minor.bottom', True) # draw x axis bottom minor ticks
296
- _set('xtick.minor.ndivs', 'auto') # number of minor ticks between the major ticks on x-axis
297
- _set('xtick.alignment', 'center') # alignment of xticks
298
- _set('ytick.left', True) # draw ticks on the left side
299
- _set('ytick.right', False) # draw ticks on the right side
300
- _set('ytick.labelleft', True) # draw tick labels on the left side
301
- _set('ytick.labelright', False) # draw tick labels on the right side
302
- _set('ytick.major.size', 3.5) # major tick size in points
303
- _set('ytick.minor.size', 2) # minor tick size in points
304
- _set('ytick.major.width', 0.8) # major tick width in points
305
- _set('ytick.minor.width', 0.6) # minor tick width in points
306
- _set('ytick.major.pad', 3.5) # distance to major tick label in points
307
- _set('ytick.minor.pad', 3.4) # distance to the minor tick label in points
308
- _set('ytick.color', 'black') # color of the ticks
309
- _set('ytick.labelcolor', 'inherit') # color of the tick labels or inherit from ytick.color
310
- _set('ytick.labelsize', 'medium') # font size of the tick labels
311
- _set('ytick.direction', 'out') # direction: {in, out, inout}
312
- _set('ytick.minor.visible', False) # visibility of minor ticks on y-axis
313
- _set('ytick.major.left', True) # draw y axis left major ticks
314
- _set('ytick.major.right', True) # draw y axis right major ticks
315
- _set('ytick.minor.left', True) # draw y axis left minor ticks
316
- _set('ytick.minor.right', True) # draw y axis right minor ticks
317
- _set('ytick.minor.ndivs', 'auto') # number of minor ticks between the major ticks on y-axis
318
- _set('ytick.alignment', 'center_baseline') # alignment of yticks
325
+ _set("xtick.labelcolor", "inherit")
326
+ _set("xtick.labelsize", "medium") # font size of the tick labels
327
+ _set("xtick.direction", "out") # direction: {in, out, inout}
328
+ _set("xtick.minor.visible", False) # visibility of minor ticks on x-axis
329
+ _set("xtick.major.top", True) # draw x axis top major ticks
330
+ _set("xtick.major.bottom", True) # draw x axis bottom major ticks
331
+ _set("xtick.minor.top", True) # draw x axis top minor ticks
332
+ _set("xtick.minor.bottom", True) # draw x axis bottom minor ticks
333
+ _set("xtick.minor.ndivs", "auto") # number of minor ticks between the major ticks on x-axis
334
+ _set("xtick.alignment", "center") # alignment of xticks
335
+ _set("ytick.left", True) # draw ticks on the left side
336
+ _set("ytick.right", False) # draw ticks on the right side
337
+ _set("ytick.labelleft", True) # draw tick labels on the left side
338
+ _set("ytick.labelright", False) # draw tick labels on the right side
339
+ _set("ytick.major.size", 3.5) # major tick size in points
340
+ _set("ytick.minor.size", 2) # minor tick size in points
341
+ _set("ytick.major.width", 0.8) # major tick width in points
342
+ _set("ytick.minor.width", 0.6) # minor tick width in points
343
+ _set("ytick.major.pad", 3.5) # distance to major tick label in points
344
+ _set("ytick.minor.pad", 3.4) # distance to the minor tick label in points
345
+ _set("ytick.color", "black") # color of the ticks
346
+ _set("ytick.labelcolor", "inherit") # color of the tick labels or inherit from ytick.color
347
+ _set("ytick.labelsize", "medium") # font size of the tick labels
348
+ _set("ytick.direction", "out") # direction: {in, out, inout}
349
+ _set("ytick.minor.visible", False) # visibility of minor ticks on y-axis
350
+ _set("ytick.major.left", True) # draw y axis left major ticks
351
+ _set("ytick.major.right", True) # draw y axis right major ticks
352
+ _set("ytick.minor.left", True) # draw y axis left minor ticks
353
+ _set("ytick.minor.right", True) # draw y axis right minor ticks
354
+ _set("ytick.minor.ndivs", "auto") # number of minor ticks between the major ticks on y-axis
355
+ _set("ytick.alignment", "center_baseline") # alignment of yticks
319
356
 
320
357
  # Grids
321
- _set('grid.color', '#c0c0c0') # grid color
322
- _set('grid.linestyle', '--') # line style
323
- _set('grid.linewidth', 0.8) # in points
324
- _set('grid.alpha', 0.8) # transparency, between 0.0 and 1.0
358
+ _set("grid.color", "#c0c0c0") # grid color
359
+ _set("grid.linestyle", "--") # line style
360
+ _set("grid.linewidth", 0.8) # in points
361
+ _set("grid.alpha", 0.8) # transparency, between 0.0 and 1.0
325
362
 
326
363
 
327
364
  # Legends
328
- _set('legend.loc', 'best')
329
- _set('legend.frameon', True) # if True, draw the legend on a background patch
330
- _set('legend.framealpha', 0.75) # legend patch transparency
331
- _set('legend.facecolor', 'inherit') # inherit from axes.facecolor; or color spec
332
- _set('legend.edgecolor', '#a0a0a0') # background patch boundary color
365
+ _set("legend.loc", "best")
366
+ _set("legend.frameon", True) # if True, draw the legend on a background patch
367
+ _set("legend.framealpha", 0.75) # legend patch transparency
368
+ _set("legend.facecolor", "inherit") # inherit from axes.facecolor; or color spec
369
+ _set("legend.edgecolor", "#a0a0a0") # background patch boundary color
333
370
  # If True, use a rounded box for the legend background, else a rectangle
334
- _set('legend.fancybox', True)
335
- _set('legend.shadow', False) # if True, give background a shadow effect
336
- _set('legend.numpoints', 1) # the number of marker points in the legend line
337
- _set('legend.scatterpoints', 1) # number of scatter points
338
- _set('legend.markerscale', 1.0) # the relative size of legend markers vs. original
339
- _set('legend.fontsize', 'small')
340
- _set('legend.labelcolor', None)
341
- _set('legend.title_fontsize', None) # None sets to the same as the default axes.
371
+ _set("legend.fancybox", True)
372
+ _set("legend.shadow", False) # if True, give background a shadow effect
373
+ _set("legend.numpoints", 1) # the number of marker points in the legend line
374
+ _set("legend.scatterpoints", 1) # number of scatter points
375
+ _set("legend.markerscale", 1.0) # the relative size of legend markers vs. original
376
+ _set("legend.fontsize", "small")
377
+ _set("legend.labelcolor", None)
378
+ _set("legend.title_fontsize", None) # None sets to the same as the default axes.
342
379
  # Dimensions as fraction of font size:
343
- _set('legend.borderpad', 0.4) # border whitespace
344
- _set('legend.labelspacing', 0.5) # the vertical space between the legend entries
345
- _set('legend.handlelength', 2.0) # the length of the legend lines
346
- _set('legend.handleheight', 0.7) # the height of the legend handle
347
- _set('legend.handletextpad', 0.8) # the space between the legend line and legend text
348
- _set('legend.borderaxespad', 0.5) # the border between the axes and legend edge
349
- _set('legend.columnspacing', 2.0) # column separation
380
+ _set("legend.borderpad", 0.4) # border whitespace
381
+ _set("legend.labelspacing", 0.5) # the vertical space between the legend entries
382
+ _set("legend.handlelength", 2.0) # the length of the legend lines
383
+ _set("legend.handleheight", 0.7) # the height of the legend handle
384
+ _set("legend.handletextpad", 0.8) # the space between the legend line and legend text
385
+ _set("legend.borderaxespad", 0.5) # the border between the axes and legend edge
386
+ _set("legend.columnspacing", 2.0) # column separation
350
387
 
351
388
  # Figures
352
389
  ## See https://matplotlib.org/stable/api/figure_api.html#matplotlib.figure.Figure
353
- _set('figure.titlesize', 'large') # size of the figure title
354
- _set('figure.titleweight', 'normal') # weight of the figure title
355
- _set('figure.labelsize', 'large') # size of the figure label
356
- _set('figure.labelweight', 'normal') # weight of the figure label
357
- _set('figure.figsize', DEFAULT_FIGURE_SIZE) # figure size in inches
358
- _set('figure.dpi', 100) # figure dots per inch
359
- _set('figure.facecolor', 'white') # figure face color
360
- _set('figure.edgecolor', 'white') # figure edge color
361
- _set('figure.frameon', True) # enable figure frame
362
- _set('figure.max_open_warning', 20)
363
- _set('figure.raise_window', True) # Raise the GUI window to front when show() is called
390
+ _set("figure.titlesize", "large") # size of the figure title
391
+ _set("figure.titleweight", "normal") # weight of the figure title
392
+ _set("figure.labelsize", "large") # size of the figure label
393
+ _set("figure.labelweight", "normal") # weight of the figure label
394
+ _set("figure.figsize", DEFAULT_FIGURE_SIZE) # figure size in inches
395
+ _set("figure.dpi", 100) # figure dots per inch
396
+ _set("figure.facecolor", "white") # figure face color
397
+ _set("figure.edgecolor", "white") # figure edge color
398
+ _set("figure.frameon", True) # enable figure frame
399
+ _set("figure.max_open_warning", 20)
400
+ _set("figure.raise_window", True) # Raise the GUI window to front when show() is called
364
401
  # The figure subplot parameters.
365
402
  # All dimensions are a fraction of the figure width and height.
366
- _set('figure.subplot.left', 0.125) # the left side of the subplots of the figure
367
- _set('figure.subplot.right', 0.97) # the right side of the subplots of the figure
368
- _set('figure.subplot.bottom', 0.11) # the bottom of the subplots of the figure
369
- _set('figure.subplot.top', 0.96) # the top of the subplots of the figure
403
+ _set("figure.subplot.left", 0.125) # the left side of the subplots of the figure
404
+ _set("figure.subplot.right", 0.97) # the right side of the subplots of the figure
405
+ _set("figure.subplot.bottom", 0.11) # the bottom of the subplots of the figure
406
+ _set("figure.subplot.top", 0.96) # the top of the subplots of the figure
370
407
  # Amount of width reserved for space between subplots, expressed as a fraction
371
408
  # of the average axis width.
372
- _set('figure.subplot.wspace', 0.2)
409
+ _set("figure.subplot.wspace", 0.2)
373
410
  # Amount of height reserved for space between subplots, expressed as a fraction
374
411
  # of the average axis height
375
- _set('figure.subplot.hspace', 0.2)
412
+ _set("figure.subplot.hspace", 0.2)
376
413
  # When True, automatically adjust subplot parameters to make the plot fit the figure
377
414
  # using `tight_layout`
378
- _set('figure.autolayout', False)
415
+ _set("figure.autolayout", False)
379
416
  # When True, automatically make plot elements fit on the figure.
380
417
  # (Not compatible with `autolayout`, above).
381
- _set('figure.constrained_layout.use', False)
418
+ _set("figure.constrained_layout.use", False)
382
419
  # Padding (in inches) around axes; defaults to 3/72 inches, i.e. 3 points.
383
- _set('figure.constrained_layout.h_pad', 0.04167)
384
- _set('figure.constrained_layout.w_pad', 0.04167)
420
+ _set("figure.constrained_layout.h_pad", 0.04167)
421
+ _set("figure.constrained_layout.w_pad", 0.04167)
385
422
  # Spacing between subplots, relative to the subplot sizes. Much smaller than for
386
423
  # tight_layout (figure.subplot.hspace, figure.subplot.wspace) as constrained_layout
387
424
  # already takes surrounding texts (titles, labels, # ticklabels) into account.
388
- _set('figure.constrained_layout.hspace', 0.02)
389
- _set('figure.constrained_layout.wspace', 0.02)
425
+ _set("figure.constrained_layout.hspace", 0.02)
426
+ _set("figure.constrained_layout.wspace", 0.02)
390
427
 
391
428
  # Images
392
- _set('image.aspect', 'equal') # {equal, auto} or a number
393
- _set('image.interpolation', 'auto') # see help(imshow) for options
394
- _set('image.interpolation_stage', 'auto') # see help(imshow) for options
395
- _set('image.cmap', 'viridis') # A colormap name (plasma, magma, etc.)
396
- _set('image.lut', 256) # the size of the colormap lookup table
397
- _set('image.origin', 'upper') # {lower, upper}
398
- _set('image.resample', True)
429
+ _set("image.aspect", "equal") # {equal, auto} or a number
430
+ _set("image.interpolation", "auto") # see help(imshow) for options
431
+ _set("image.interpolation_stage", "auto") # see help(imshow) for options
432
+ _set("image.cmap", "viridis") # A colormap name (plasma, magma, etc.)
433
+ _set("image.lut", 256) # the size of the colormap lookup table
434
+ _set("image.origin", "upper") # {lower, upper}
435
+ _set("image.resample", True)
399
436
  # When True, all the images on a set of axes are combined into a single composite
400
437
  # image before saving a figure as a vector graphics file, such as a PDF.
401
- _set('image.composite_image', True)
438
+ _set("image.composite_image", True)
402
439
 
403
440
  # Various plots.
404
- _set('contour.negative_linestyle', 'dashed') # string or on-off ink sequence
405
- _set('contour.corner_mask', True) # {True, False}
406
- _set('contour.linewidth', None)
407
- _set('contour.algorithm', 'mpl2014') # {mpl2005, mpl2014, serial, threaded}
408
- _set('errorbar.capsize', 0) # length of end cap on error bars in pixels
409
- _set('hist.bins', 10) # The default number of histogram bins or 'auto'.
410
- _set('scatter.marker', 'o') # The default marker type for scatter plots.
411
- _set('scatter.edgecolors', 'face') # The default edge colors for scatter plots.
441
+ _set("contour.negative_linestyle", "dashed") # string or on-off ink sequence
442
+ _set("contour.corner_mask", True) # {True, False}
443
+ _set("contour.linewidth", None)
444
+ _set("contour.algorithm", "mpl2014") # {mpl2005, mpl2014, serial, threaded}
445
+ _set("errorbar.capsize", 0) # length of end cap on error bars in pixels
446
+ _set("hist.bins", 10) # The default number of histogram bins or "auto".
447
+ _set("scatter.marker", "o") # The default marker type for scatter plots.
448
+ _set("scatter.edgecolors", "face") # The default edge colors for scatter plots.
412
449
 
413
450
  # Paths
414
451
  # When True, simplify paths by removing "invisible" points to reduce file size
415
452
  # and increase rendering speed
416
- _set('path.simplify', True)
453
+ _set("path.simplify", True)
417
454
  # The threshold of similarity below which vertices will be removed in
418
455
  # the simplification process.
419
- _set('path.simplify_threshold', 0.111111111111)
456
+ _set("path.simplify_threshold", 0.111111111111)
420
457
  # When True, rectilinear axis-aligned paths will be snapped to the nearest pixel
421
458
  # when certain criteria are met. When False, paths will never be snapped.
422
- _set('path.snap', True)
459
+ _set("path.snap", True)
423
460
  # May be None, or a tuple of the form: path.sketch: (scale, length, randomness)
424
461
  # - scale is the amplitude of the wiggle perpendicular to the line (in pixels).
425
462
  # - length is the length of the wiggle along the line (in pixels).
426
463
  # - randomness is the factor by which the length is randomly scaled.
427
- _set('path.sketch', None)
464
+ _set("path.sketch", None)
428
465
 
429
466
  # Saving figures...
430
467
  # The default savefig parameters can be different from the display parameters
431
- _set('savefig.dpi', 300) # figure dots per inch or 'figure'
432
- _set('savefig.facecolor', 'auto') # figure face color when saving
433
- _set('savefig.edgecolor', 'auto') # figure edge color when saving
434
- _set('savefig.format', 'png') # {png, ps, pdf, svg}
435
- _set('savefig.bbox', 'standard') # {tight, standard}
436
- _set('savefig.pad_inches', 0.1) # padding to be used, when bbox is set to 'tight'
468
+ _set("savefig.dpi", 300) # figure dots per inch or "figure"
469
+ _set("savefig.facecolor", "auto") # figure face color when saving
470
+ _set("savefig.edgecolor", "auto") # figure edge color when saving
471
+ _set("savefig.format", "png") # {png, ps, pdf, svg}
472
+ _set("savefig.bbox", "standard") # {tight, standard}
473
+ _set("savefig.pad_inches", 0.1) # padding to be used, when bbox is set to "tight"
437
474
  # Default directory in savefig dialog, gets updated after interactive saves,
438
- # unless set to the empty string (i.e. the current directory); use '.' to start
475
+ # unless set to the empty string (i.e. the current directory); use "." to start
439
476
  # at the current directory but update after interactive saves
440
- _set('savefig.directory', '')
477
+ _set("savefig.directory", "")
441
478
  # Whether figures are saved with a transparent background by default
442
- _set('savefig.transparent', False)
479
+ _set("savefig.transparent", False)
443
480
  # Orientation of saved figure, for PostScript output only
444
- _set('savefig.orientation', 'portrait')
445
- _set('macosx.window_mode', 'system')
446
- _set('tk.window_focus', False) # Maintain shell focus for TkAgg
481
+ _set("savefig.orientation", "portrait")
482
+ _set("macosx.window_mode", "system")
483
+ _set("tk.window_focus", False) # Maintain shell focus for TkAgg
447
484
  # Integer from 0 to 9, 0 disables compression (good for debugging)
448
- _set('pdf.compression', 6)
449
- _set('pdf.fonttype', 3) # Output Type 3 (Type3) or Type 42 (TrueType)
450
- _set('pdf.use14corefonts', False)
451
- _set('pdf.inheritcolor', False)
452
- _set('svg.image_inline', True) # Write raster image data directly into the SVG file
485
+ _set("pdf.compression", 6)
486
+ _set("pdf.fonttype", 3) # Output Type 3 (Type3) or Type 42 (TrueType)
487
+ _set("pdf.use14corefonts", False)
488
+ _set("pdf.inheritcolor", False)
489
+ _set("svg.image_inline", True) # Write raster image data directly into the SVG file
453
490
  # How to handle SVG fonts:
454
491
  # - path: embed characters as paths -- supported by most SVG renderers
455
492
  # - None: assume fonts are installed on the machine where the SVG will be viewed.
456
- _set('svg.fonttype', 'path')
457
- _set('svg.hashsalt', None) # If not None, use this string as hash salt instead of uuid4
493
+ _set("svg.fonttype", "path")
494
+ _set("svg.hashsalt", None) # If not None, use this string as hash salt instead of uuid4
458
495
  # If not None, use this string as the value for the `id` attribute in the top <svg> tag
459
- _set('svg.id', None)
496
+ _set("svg.id", None)
460
497
  # See https://matplotlib.org/stable/tutorials/text/pgf.html for more information.
461
- _set('pgf.rcfonts', True)
462
- _set('pgf.texsystem', 'xelatex')
463
- _set('docstring.hardcopy', False) # set this when you want to generate hardcopy docstring
498
+ _set("pgf.rcfonts", True)
499
+ _set("pgf.texsystem", "xelatex")
500
+ _set("docstring.hardcopy", False) # set this when you want to generate hardcopy docstring
464
501
 
465
502
  # Animations
466
503
  # How to display the animation as HTML in the IPython notebook:
467
- # - 'html5' uses HTML5 video tag
468
- # - 'jshtml' creates a JavaScript animation
469
- _set('animation.html', 'none')
470
- _set('animation.writer', 'ffmpeg') # MovieWriter 'backend' to use
471
- _set('animation.codec', 'h264') # Codec to use for writing movie
504
+ # - "html5" uses HTML5 video tag
505
+ # - "jshtml" creates a JavaScript animation
506
+ _set("animation.html", "none")
507
+ _set("animation.writer", "ffmpeg") # MovieWriter "backend" to use
508
+ _set("animation.codec", "h264") # Codec to use for writing movie
472
509
  # Controls size/quality trade-off for movie.
473
510
  # -1 implies let utility auto-determine
474
- _set('animation.bitrate', -1)
475
- _set('animation.frame_format', 'png') # Controls frame format used by temp files
511
+ _set("animation.bitrate", -1)
512
+ _set("animation.frame_format", "png") # Controls frame format used by temp files
476
513
  # Path to ffmpeg binary. Unqualified paths are resolved by subprocess.Popen.
477
- _set('animation.ffmpeg_path', 'ffmpeg')
478
- # Path to ImageMagick's convert binary. Unqualified paths are resolved by
514
+ _set("animation.ffmpeg_path", "ffmpeg")
515
+ # Path to ImageMagick"s convert binary. Unqualified paths are resolved by
479
516
  # subprocess.Popen, except that on Windows, we look up an install of
480
517
  # ImageMagick in the registry (as convert is also the name of a system tool).
481
- _set('animation.convert_path', 'convert')
518
+ _set("animation.convert_path", "convert")
482
519
  # Limit, in MB, of size of base64 encoded animation in HTML (i.e. IPython notebook)
483
- _set('animation.embed_limit', 20.0)
520
+ _set("animation.embed_limit", 20.0)
484
521
 
485
522
 
486
523
  configure()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aptapy
3
- Version: 0.1.1
3
+ Version: 0.2.0
4
4
  Summary: Statistical tools for online monitoring and analysis
5
5
  Project-URL: Homepage, https://github.com/lucabaldini/aptapy
6
6
  Project-URL: Issues, https://github.com/lucabaldini/aptapy/issues
@@ -0,0 +1,11 @@
1
+ aptapy/__init__.py,sha256=a7Au1ukdeJbjiIZ-UL-qZE1xk-d2WnKKkoqjg_0SzqA,1707
2
+ aptapy/_version.py,sha256=Zn1KFblwuFHiDRdRAiRnDBRkbPttWh44jKa5zG2ov0E,22
3
+ aptapy/hist.py,sha256=5fiaYEnSQ7b_jSsZdRvXrIGr2vTMlW_55jkFpE8L3Sw,8158
4
+ aptapy/modeling.py,sha256=V8DVfmwFyUfy9-YZXd9Hz5rlyGEy12xoyn-oJ4ss3W0,18236
5
+ aptapy/plotting.py,sha256=ZixAVF83qIuITjzQJBUvMNCK-REilzyAt0vxgcMbCOk,27125
6
+ aptapy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ aptapy/typing_.py,sha256=JIbEqKI8kn_fd90yDt0JmI1AojjmLhAEB_1RfMFxLx4,807
8
+ aptapy-0.2.0.dist-info/METADATA,sha256=yvpj0nK8DKrbXcccDPqKeiruxJYAGEK0FYaIKa4UpS0,41456
9
+ aptapy-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ aptapy-0.2.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
11
+ aptapy-0.2.0.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- aptapy/__init__.py,sha256=a7Au1ukdeJbjiIZ-UL-qZE1xk-d2WnKKkoqjg_0SzqA,1707
2
- aptapy/_version.py,sha256=rnObPjuBcEStqSO0S6gsdS_ot8ITOQjVj_-P1LUUYpg,22
3
- aptapy/modeling.py,sha256=Ba-kHfvwjSc5oM3XZGsxN5wAONQZaKmICQa-P65qxNE,18234
4
- aptapy/plotting.py,sha256=Pv0uo7fqoKYmyFmX2CiSRujzTkYNKiUsW7ZHSBWQowE,25991
5
- aptapy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- aptapy/typing_.py,sha256=JIbEqKI8kn_fd90yDt0JmI1AojjmLhAEB_1RfMFxLx4,807
7
- aptapy-0.1.1.dist-info/METADATA,sha256=bJ44czUH6kc516OHBIbge9neKPWTm3jAyz2fBEvPUkY,41456
8
- aptapy-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- aptapy-0.1.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
10
- aptapy-0.1.1.dist-info/RECORD,,
File without changes