Constraints Anaysis¶
Download this as a Jupyter notebook
This example notebook illustrates xLA features that are useful for problems with constraints.
Lets defined a constrained sphere problem, with the sphere function as the objective:
with the following constraints,
The sphere function is visualised below:
Equation (2) is visualised below:
Equation (3) is visualised below:
Let us define the problem as a sample
from pyxla import load_data
from pyxla.sampling import HilbertCurveSampler
import math
sphere_f = lambda x: x** 2
sphere_sample = {
"name": "Sphere",
"X": HilbertCurveSampler(sample_size=100, dim=1, l_bound=-5, u_bound=5),
"F": sphere_f,
"V": [lambda x: sphere_f(x) - 2, lambda x: 8 * math.sin(20 * x)]
}
load_data(sphere_sample) # loaded in-place
WARNING:root:The Hilbert curve with dimension 1 is just a number line. You are sampling around points on a number line.
Violation distribution (distr_V)¶
pyxla.distr_v() can show the distribution of violation values for the two constraints:
from pyxla import distr_v
feat, plot = distr_v(sphere_sample)
feat
{'v0_min': 0.0,
'v0_max': 23.0,
'v0_mean': 7.09599675993694,
'v0_med': 4.823811008445192,
'v0_q1': 0.0,
'v0_q3': 13.025666005082412,
'v0_sd': 7.375198758769731,
'v0_skew': 0.6941768736271815,
'v0_kurt': -0.8617340263008342,
'v0_feas_rate': 0.27,
'v1_min': 0.0,
'v1_max': 7.999600456528671,
'v1_mean': 2.4626471911853036,
'v1_med': 0.0,
'v1_q1': 0.0,
'v1_q3': 5.506725209159034,
'v1_sd': 3.0378721274130953,
'v1_skew': 0.652795050784104,
'v1_kurt': -1.2675436724160962,
'v1_feas_rate': 0.52,
'overall_feas_rate': 0.11}
Error in callback <function _draw_all_if_interactive at 0x79ab71c76e50> (for post_execute), with arguments args (),kwargs {}:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
257 try:
--> 258 report = subprocess.check_output(
259 command, cwd=cwd if cwd is not None else cls._cache_dir,
260 stderr=subprocess.STDOUT)
261 except subprocess.CalledProcessError as exc:
File /usr/local/lib/python3.14/subprocess.py:473, in check_output(timeout, *popenargs, **kwargs)
471 kwargs['input'] = empty
--> 473 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
474 **kwargs).stdout
File /usr/local/lib/python3.14/subprocess.py:555, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
553 kwargs['stderr'] = PIPE
--> 555 with Popen(*popenargs, **kwargs) as process:
556 try:
File /usr/local/lib/python3.14/subprocess.py:1039, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1036 self.stderr = io.TextIOWrapper(self.stderr,
1037 encoding=encoding, errors=errors)
-> 1039 self._execute_child(args, executable, preexec_fn, close_fds,
1040 pass_fds, cwd, env,
1041 startupinfo, creationflags, shell,
1042 p2cread, p2cwrite,
1043 c2pread, c2pwrite,
1044 errread, errwrite,
1045 restore_signals,
1046 gid, gids, uid, umask,
1047 start_new_session, process_group)
1048 except:
1049 # Cleanup if the child failed starting.
File /usr/local/lib/python3.14/subprocess.py:1990, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
1989 if err_filename is not None:
-> 1990 raise child_exception_type(errno_num, err_msg, err_filename)
1991 else:
FileNotFoundError: [Errno 2] No such file or directory: 'latex'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/pyplot.py:300, in _draw_all_if_interactive()
298 def _draw_all_if_interactive() -> None:
299 if matplotlib.is_interactive():
--> 300 draw_all()
File /usr/local/lib/python3.14/site-packages/matplotlib/_pylab_helpers.py:133, in Gcf.draw_all(cls, force)
131 for manager in cls.get_all_fig_managers():
132 if force or manager.canvas.figure.stale:
--> 133 manager.canvas.draw_idle()
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:1989, in FigureCanvasBase.draw_idle(self, *args, **kwargs)
1987 if not self._is_idle_drawing:
1988 with self._idle_draw_cntx():
-> 1989 self.draw(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:438, in FigureCanvasAgg.draw(self)
435 # Acquire a lock on the shared font cache.
436 with (self.toolbar._wait_cursor_for_draw_cm() if self.toolbar
437 else nullcontext()):
--> 438 self.figure.draw(self.renderer)
439 # A GUI class may be need to update a window using this draw, so
440 # don't forget to call the superclass.
441 super().draw()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:94, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
92 @wraps(draw)
93 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 94 result = draw(artist, renderer, *args, **kwargs)
95 if renderer._rasterizing:
96 renderer.stop_rasterizing()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:71, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
68 if artist.get_agg_filter() is not None:
69 renderer.start_filter()
---> 71 return draw(artist, renderer)
72 finally:
73 if artist.get_agg_filter() is not None:
File /usr/local/lib/python3.14/site-packages/matplotlib/figure.py:3276, in Figure.draw(self, renderer)
3274 if self.axes and self.get_layout_engine() is not None:
3275 try:
-> 3276 self.get_layout_engine().execute(self)
3277 except ValueError:
3278 pass
File /usr/local/lib/python3.14/site-packages/matplotlib/layout_engine.py:278, in ConstrainedLayoutEngine.execute(self, fig)
275 w_pad = self._params['w_pad'] / width
276 h_pad = self._params['h_pad'] / height
--> 278 return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
279 wspace=self._params['wspace'],
280 hspace=self._params['hspace'],
281 rect=self._params['rect'],
282 compress=self._compress)
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:116, in do_constrained_layout(fig, h_pad, w_pad, hspace, wspace, rect, compress)
106 return
108 for _ in range(2):
109 # do the algorithm twice. This has to be done because decorations
110 # change size after the first re-position (i.e. x/yticklabels get
(...) 114 # make margins for all the Axes and subfigures in the
115 # figure. Add margins for colorbars...
--> 116 make_layout_margins(layoutgrids, fig, renderer, h_pad=h_pad,
117 w_pad=w_pad, hspace=hspace, wspace=wspace)
118 make_margin_suptitles(layoutgrids, fig, renderer, h_pad=h_pad,
119 w_pad=w_pad)
121 # if a layout is such that a columns (or rows) margin has no
122 # constraints, we need to make all such instances in the grid
123 # match in margin size.
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:389, in make_layout_margins(layoutgrids, fig, renderer, w_pad, h_pad, hspace, wspace)
385 return
387 margin = get_margin_from_padding(ax, w_pad=w_pad, h_pad=h_pad,
388 hspace=hspace, wspace=wspace)
--> 389 pos, bbox = get_pos_and_bbox(ax, renderer)
390 # the margin is the distance between the bounding box of the Axes
391 # and its position (plus the padding from above)
392 margin['left'] += pos.x0 - bbox.x0
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:637, in get_pos_and_bbox(ax, renderer)
635 # pos is in panel co-ords, but we need in figure for the layout
636 pos = pos.transformed(fig.transSubfigure - fig.transFigure)
--> 637 tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer)
638 if tightbbox is None:
639 bbox = pos
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axes/_base.py:4758, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4756 if self.axison and axis.get_visible():
4757 if for_layout_only:
-> 4758 ba = martist._get_tightbbox_for_layout_only(axis, renderer)
4759 else:
4760 ba = axis.get_tightbbox(renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1427, in Axis.get_tightbbox(self, renderer, for_layout_only)
1424 renderer = self.get_figure(root=True)._get_renderer()
1425 ticks_to_draw = self._update_ticks()
-> 1427 self._update_label_position(renderer)
1429 # go back to just this axis's tick labels
1430 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2615, in XAxis._update_label_position(self, renderer)
2611 return
2613 # get bounding boxes for this axis and any siblings
2614 # that have been set by `fig.align_xlabels()`
-> 2615 bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
2616 x, y = self.label.get_position()
2618 if self.label_position == 'bottom':
2619 # Union with extents of the bottom spine if present, of the axes otherwise.
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2403, in Axis._get_tick_boxes_siblings(self, renderer)
2401 axis = ax._axis_map[name]
2402 ticks_to_draw = axis._update_ticks()
-> 2403 tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
2404 bboxes.extend(tlb)
2405 bboxes2.extend(tlb2)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1404, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
1402 def _get_ticklabel_bboxes(self, ticks, renderer):
1403 """Return lists of bboxes for ticks' label1's and label2's."""
-> 1404 return ([tick.label1.get_window_extent(renderer)
1405 for tick in ticks
1406 if tick.label1.get_visible() and tick.label1.get_in_layout()],
1407 [tick.label2.get_window_extent(renderer)
1408 for tick in ticks
1409 if tick.label2.get_visible() and tick.label2.get_in_layout()])
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:1076, in Text.get_window_extent(self, renderer, dpi)
1071 raise RuntimeError(
1072 "Cannot get window extent of text w/o renderer. You likely "
1073 "want to call 'figure.draw_without_rendering()' first.")
1075 with cbook._setattr_cm(fig, dpi=dpi):
-> 1076 bbox, _, _ = self._get_layout(self._renderer)
1077 x, y = self.get_unitless_position()
1078 x, y = self.get_transform().transform((x, y))
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:465, in Text._get_layout(self, renderer)
462 break
463 if None in (min_ascent, min_descent):
464 # Fallback to font measurement.
--> 465 _, h, min_descent = _get_text_metrics_with_cache(
466 renderer, "lp", self._fontproperties,
467 ismath="TeX" if self.get_usetex() else False,
468 dpi=dpi)
469 min_ascent = h - min_descent
470 line_gap = 0
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:59, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
52 get_text_metrics = _get_text_metrics_function(renderer)
53 # call the function to compute the metrics and return
54 #
55 # We pass a copy of the fontprop because FontProperties is both mutable and
56 # has a `__hash__` that depends on that mutable state. This is not ideal
57 # as it means the hash of an object is not stable over time which leads to
58 # very confusing behavior when used as keys in dictionaries or hashes.
---> 59 return get_text_metrics(text, fontprop.copy(), ismath, dpi)
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:125, in _get_text_metrics_function.<locals>._text_metrics(text, fontprop, ismath, dpi)
120 raise RuntimeError(
121 "Trying to get text metrics for a renderer that no longer exists. "
122 "This should never happen and is evidence of a bug elsewhere."
123 )
124 # do the actual method call we need and return the result
--> 125 return local_renderer.get_text_width_height_descent(text, fontprop, ismath)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:256, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
254 _api.check_in_list(["TeX", True, False], ismath=ismath)
255 if ismath == "TeX":
--> 256 return super().get_text_width_height_descent(s, prop, ismath)
258 if ismath:
259 parse = self.mathtext_parser.parse(s, self.dpi, prop)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:589, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
585 fontsize = prop.get_size_in_points()
587 if ismath == 'TeX':
588 # todo: handle properties
--> 589 return self.get_texmanager().get_text_width_height_descent(
590 s, fontsize, renderer=self)
592 dpi = self.points_to_pixels(72)
593 if ismath:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:369, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
367 if tex.strip() == '':
368 return 0, 0, 0
--> 369 dvipath = cls.make_dvi(tex, fontsize)
370 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
371 with dviread.Dvi(dvipath, 72 * dpi_fraction) as dvi:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:301, in TexManager.make_dvi(cls, tex, fontsize)
298 with TemporaryDirectory(dir=dvipath.parent) as tmpdir:
299 Path(tmpdir, "file.tex").write_text(
300 cls._get_tex_source(tex, fontsize), encoding='utf-8')
--> 301 cls._run_checked_subprocess(
302 ["latex", "-interaction=nonstopmode", "-halt-on-error",
303 "-no-shell-escape", "file.tex"], tex, cwd=tmpdir)
304 Path(tmpdir, "file.dvi").replace(dvipath)
305 # Also move the tex source to the main cache directory, but
306 # only for backcompat.
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:274, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
262 raise RuntimeError(
263 '{prog} was not able to process the following string:\n'
264 '{tex!r}\n\n'
(...) 271 exc=exc.output.decode('utf-8', 'backslashreplace'))
272 ) from None
273 except (FileNotFoundError, OSError) as exc:
--> 274 raise RuntimeError(
275 f'Failed to process string with tex because {command[0]} '
276 'could not be found') from exc
277 _log.debug(report)
278 return report
RuntimeError: Failed to process string with tex because latex could not be found
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
257 try:
--> 258 report = subprocess.check_output(
259 command, cwd=cwd if cwd is not None else cls._cache_dir,
260 stderr=subprocess.STDOUT)
261 except subprocess.CalledProcessError as exc:
File /usr/local/lib/python3.14/subprocess.py:473, in check_output(timeout, *popenargs, **kwargs)
471 kwargs['input'] = empty
--> 473 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
474 **kwargs).stdout
File /usr/local/lib/python3.14/subprocess.py:555, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
553 kwargs['stderr'] = PIPE
--> 555 with Popen(*popenargs, **kwargs) as process:
556 try:
File /usr/local/lib/python3.14/subprocess.py:1039, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1036 self.stderr = io.TextIOWrapper(self.stderr,
1037 encoding=encoding, errors=errors)
-> 1039 self._execute_child(args, executable, preexec_fn, close_fds,
1040 pass_fds, cwd, env,
1041 startupinfo, creationflags, shell,
1042 p2cread, p2cwrite,
1043 c2pread, c2pwrite,
1044 errread, errwrite,
1045 restore_signals,
1046 gid, gids, uid, umask,
1047 start_new_session, process_group)
1048 except:
1049 # Cleanup if the child failed starting.
File /usr/local/lib/python3.14/subprocess.py:1990, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
1989 if err_filename is not None:
-> 1990 raise child_exception_type(errno_num, err_msg, err_filename)
1991 else:
FileNotFoundError: [Errno 2] No such file or directory: 'latex'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:2257, in FigureCanvasBase.print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)
2254 # we do this instead of `self.figure.draw_without_rendering`
2255 # so that we can inject the orientation
2256 with getattr(renderer, "_draw_disabled", nullcontext)():
-> 2257 self.figure.draw(renderer)
2258 else:
2259 renderer = None
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:94, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
92 @wraps(draw)
93 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 94 result = draw(artist, renderer, *args, **kwargs)
95 if renderer._rasterizing:
96 renderer.stop_rasterizing()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:71, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
68 if artist.get_agg_filter() is not None:
69 renderer.start_filter()
---> 71 return draw(artist, renderer)
72 finally:
73 if artist.get_agg_filter() is not None:
File /usr/local/lib/python3.14/site-packages/matplotlib/figure.py:3276, in Figure.draw(self, renderer)
3274 if self.axes and self.get_layout_engine() is not None:
3275 try:
-> 3276 self.get_layout_engine().execute(self)
3277 except ValueError:
3278 pass
File /usr/local/lib/python3.14/site-packages/matplotlib/layout_engine.py:278, in ConstrainedLayoutEngine.execute(self, fig)
275 w_pad = self._params['w_pad'] / width
276 h_pad = self._params['h_pad'] / height
--> 278 return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
279 wspace=self._params['wspace'],
280 hspace=self._params['hspace'],
281 rect=self._params['rect'],
282 compress=self._compress)
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:116, in do_constrained_layout(fig, h_pad, w_pad, hspace, wspace, rect, compress)
106 return
108 for _ in range(2):
109 # do the algorithm twice. This has to be done because decorations
110 # change size after the first re-position (i.e. x/yticklabels get
(...) 114 # make margins for all the Axes and subfigures in the
115 # figure. Add margins for colorbars...
--> 116 make_layout_margins(layoutgrids, fig, renderer, h_pad=h_pad,
117 w_pad=w_pad, hspace=hspace, wspace=wspace)
118 make_margin_suptitles(layoutgrids, fig, renderer, h_pad=h_pad,
119 w_pad=w_pad)
121 # if a layout is such that a columns (or rows) margin has no
122 # constraints, we need to make all such instances in the grid
123 # match in margin size.
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:389, in make_layout_margins(layoutgrids, fig, renderer, w_pad, h_pad, hspace, wspace)
385 return
387 margin = get_margin_from_padding(ax, w_pad=w_pad, h_pad=h_pad,
388 hspace=hspace, wspace=wspace)
--> 389 pos, bbox = get_pos_and_bbox(ax, renderer)
390 # the margin is the distance between the bounding box of the Axes
391 # and its position (plus the padding from above)
392 margin['left'] += pos.x0 - bbox.x0
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:637, in get_pos_and_bbox(ax, renderer)
635 # pos is in panel co-ords, but we need in figure for the layout
636 pos = pos.transformed(fig.transSubfigure - fig.transFigure)
--> 637 tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer)
638 if tightbbox is None:
639 bbox = pos
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axes/_base.py:4758, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4756 if self.axison and axis.get_visible():
4757 if for_layout_only:
-> 4758 ba = martist._get_tightbbox_for_layout_only(axis, renderer)
4759 else:
4760 ba = axis.get_tightbbox(renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1427, in Axis.get_tightbbox(self, renderer, for_layout_only)
1424 renderer = self.get_figure(root=True)._get_renderer()
1425 ticks_to_draw = self._update_ticks()
-> 1427 self._update_label_position(renderer)
1429 # go back to just this axis's tick labels
1430 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2615, in XAxis._update_label_position(self, renderer)
2611 return
2613 # get bounding boxes for this axis and any siblings
2614 # that have been set by `fig.align_xlabels()`
-> 2615 bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
2616 x, y = self.label.get_position()
2618 if self.label_position == 'bottom':
2619 # Union with extents of the bottom spine if present, of the axes otherwise.
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2403, in Axis._get_tick_boxes_siblings(self, renderer)
2401 axis = ax._axis_map[name]
2402 ticks_to_draw = axis._update_ticks()
-> 2403 tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
2404 bboxes.extend(tlb)
2405 bboxes2.extend(tlb2)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1404, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
1402 def _get_ticklabel_bboxes(self, ticks, renderer):
1403 """Return lists of bboxes for ticks' label1's and label2's."""
-> 1404 return ([tick.label1.get_window_extent(renderer)
1405 for tick in ticks
1406 if tick.label1.get_visible() and tick.label1.get_in_layout()],
1407 [tick.label2.get_window_extent(renderer)
1408 for tick in ticks
1409 if tick.label2.get_visible() and tick.label2.get_in_layout()])
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:1076, in Text.get_window_extent(self, renderer, dpi)
1071 raise RuntimeError(
1072 "Cannot get window extent of text w/o renderer. You likely "
1073 "want to call 'figure.draw_without_rendering()' first.")
1075 with cbook._setattr_cm(fig, dpi=dpi):
-> 1076 bbox, _, _ = self._get_layout(self._renderer)
1077 x, y = self.get_unitless_position()
1078 x, y = self.get_transform().transform((x, y))
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:465, in Text._get_layout(self, renderer)
462 break
463 if None in (min_ascent, min_descent):
464 # Fallback to font measurement.
--> 465 _, h, min_descent = _get_text_metrics_with_cache(
466 renderer, "lp", self._fontproperties,
467 ismath="TeX" if self.get_usetex() else False,
468 dpi=dpi)
469 min_ascent = h - min_descent
470 line_gap = 0
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:59, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
52 get_text_metrics = _get_text_metrics_function(renderer)
53 # call the function to compute the metrics and return
54 #
55 # We pass a copy of the fontprop because FontProperties is both mutable and
56 # has a `__hash__` that depends on that mutable state. This is not ideal
57 # as it means the hash of an object is not stable over time which leads to
58 # very confusing behavior when used as keys in dictionaries or hashes.
---> 59 return get_text_metrics(text, fontprop.copy(), ismath, dpi)
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:125, in _get_text_metrics_function.<locals>._text_metrics(text, fontprop, ismath, dpi)
120 raise RuntimeError(
121 "Trying to get text metrics for a renderer that no longer exists. "
122 "This should never happen and is evidence of a bug elsewhere."
123 )
124 # do the actual method call we need and return the result
--> 125 return local_renderer.get_text_width_height_descent(text, fontprop, ismath)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:256, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
254 _api.check_in_list(["TeX", True, False], ismath=ismath)
255 if ismath == "TeX":
--> 256 return super().get_text_width_height_descent(s, prop, ismath)
258 if ismath:
259 parse = self.mathtext_parser.parse(s, self.dpi, prop)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:589, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
585 fontsize = prop.get_size_in_points()
587 if ismath == 'TeX':
588 # todo: handle properties
--> 589 return self.get_texmanager().get_text_width_height_descent(
590 s, fontsize, renderer=self)
592 dpi = self.points_to_pixels(72)
593 if ismath:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:369, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
367 if tex.strip() == '':
368 return 0, 0, 0
--> 369 dvipath = cls.make_dvi(tex, fontsize)
370 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
371 with dviread.Dvi(dvipath, 72 * dpi_fraction) as dvi:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:301, in TexManager.make_dvi(cls, tex, fontsize)
298 with TemporaryDirectory(dir=dvipath.parent) as tmpdir:
299 Path(tmpdir, "file.tex").write_text(
300 cls._get_tex_source(tex, fontsize), encoding='utf-8')
--> 301 cls._run_checked_subprocess(
302 ["latex", "-interaction=nonstopmode", "-halt-on-error",
303 "-no-shell-escape", "file.tex"], tex, cwd=tmpdir)
304 Path(tmpdir, "file.dvi").replace(dvipath)
305 # Also move the tex source to the main cache directory, but
306 # only for backcompat.
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:274, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
262 raise RuntimeError(
263 '{prog} was not able to process the following string:\n'
264 '{tex!r}\n\n'
(...) 271 exc=exc.output.decode('utf-8', 'backslashreplace'))
272 ) from None
273 except (FileNotFoundError, OSError) as exc:
--> 274 raise RuntimeError(
275 f'Failed to process string with tex because {command[0]} '
276 'could not be found') from exc
277 _log.debug(report)
278 return report
RuntimeError: Failed to process string with tex because latex could not be found
<Figure size 900x600 with 6 Axes>
Pareto ranking distribution¶
from pyxla import distr_Par
distr_Par(sphere_sample)
({'paretoV_min': 0,
'paretoV_max': 42,
'paretoV_mean': 19.38,
'paretoV_med': 16.5,
'paretoV_q1': 7.25,
'paretoV_q3': 32.0,
'paretoV_sd': 13.767022520897868,
'paretoV_skew': 0.12527279561209054,
'paretoV_kurt': -1.3239951481202532,
'paretoFV_min': 0,
'paretoFV_max': 52,
'paretoFV_mean': 26.69,
'paretoFV_med': 26.5,
'paretoFV_q1': 10.25,
'paretoFV_q3': 42.0,
'paretoFV_sd': 16.67011782450347,
'paretoFV_skew': -0.044434741083962156,
'paretoFV_kurt': -1.3966984098870856},
<Figure size 600x300 with 2 Axes>)
Error in callback <function _draw_all_if_interactive at 0x79ab71c76e50> (for post_execute), with arguments args (),kwargs {}:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
257 try:
--> 258 report = subprocess.check_output(
259 command, cwd=cwd if cwd is not None else cls._cache_dir,
260 stderr=subprocess.STDOUT)
261 except subprocess.CalledProcessError as exc:
File /usr/local/lib/python3.14/subprocess.py:473, in check_output(timeout, *popenargs, **kwargs)
471 kwargs['input'] = empty
--> 473 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
474 **kwargs).stdout
File /usr/local/lib/python3.14/subprocess.py:555, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
553 kwargs['stderr'] = PIPE
--> 555 with Popen(*popenargs, **kwargs) as process:
556 try:
File /usr/local/lib/python3.14/subprocess.py:1039, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1036 self.stderr = io.TextIOWrapper(self.stderr,
1037 encoding=encoding, errors=errors)
-> 1039 self._execute_child(args, executable, preexec_fn, close_fds,
1040 pass_fds, cwd, env,
1041 startupinfo, creationflags, shell,
1042 p2cread, p2cwrite,
1043 c2pread, c2pwrite,
1044 errread, errwrite,
1045 restore_signals,
1046 gid, gids, uid, umask,
1047 start_new_session, process_group)
1048 except:
1049 # Cleanup if the child failed starting.
File /usr/local/lib/python3.14/subprocess.py:1990, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
1989 if err_filename is not None:
-> 1990 raise child_exception_type(errno_num, err_msg, err_filename)
1991 else:
FileNotFoundError: [Errno 2] No such file or directory: 'latex'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/pyplot.py:300, in _draw_all_if_interactive()
298 def _draw_all_if_interactive() -> None:
299 if matplotlib.is_interactive():
--> 300 draw_all()
File /usr/local/lib/python3.14/site-packages/matplotlib/_pylab_helpers.py:133, in Gcf.draw_all(cls, force)
131 for manager in cls.get_all_fig_managers():
132 if force or manager.canvas.figure.stale:
--> 133 manager.canvas.draw_idle()
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:1989, in FigureCanvasBase.draw_idle(self, *args, **kwargs)
1987 if not self._is_idle_drawing:
1988 with self._idle_draw_cntx():
-> 1989 self.draw(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:438, in FigureCanvasAgg.draw(self)
435 # Acquire a lock on the shared font cache.
436 with (self.toolbar._wait_cursor_for_draw_cm() if self.toolbar
437 else nullcontext()):
--> 438 self.figure.draw(self.renderer)
439 # A GUI class may be need to update a window using this draw, so
440 # don't forget to call the superclass.
441 super().draw()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:94, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
92 @wraps(draw)
93 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 94 result = draw(artist, renderer, *args, **kwargs)
95 if renderer._rasterizing:
96 renderer.stop_rasterizing()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:71, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
68 if artist.get_agg_filter() is not None:
69 renderer.start_filter()
---> 71 return draw(artist, renderer)
72 finally:
73 if artist.get_agg_filter() is not None:
File /usr/local/lib/python3.14/site-packages/matplotlib/figure.py:3276, in Figure.draw(self, renderer)
3274 if self.axes and self.get_layout_engine() is not None:
3275 try:
-> 3276 self.get_layout_engine().execute(self)
3277 except ValueError:
3278 pass
File /usr/local/lib/python3.14/site-packages/matplotlib/layout_engine.py:278, in ConstrainedLayoutEngine.execute(self, fig)
275 w_pad = self._params['w_pad'] / width
276 h_pad = self._params['h_pad'] / height
--> 278 return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
279 wspace=self._params['wspace'],
280 hspace=self._params['hspace'],
281 rect=self._params['rect'],
282 compress=self._compress)
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:116, in do_constrained_layout(fig, h_pad, w_pad, hspace, wspace, rect, compress)
106 return
108 for _ in range(2):
109 # do the algorithm twice. This has to be done because decorations
110 # change size after the first re-position (i.e. x/yticklabels get
(...) 114 # make margins for all the Axes and subfigures in the
115 # figure. Add margins for colorbars...
--> 116 make_layout_margins(layoutgrids, fig, renderer, h_pad=h_pad,
117 w_pad=w_pad, hspace=hspace, wspace=wspace)
118 make_margin_suptitles(layoutgrids, fig, renderer, h_pad=h_pad,
119 w_pad=w_pad)
121 # if a layout is such that a columns (or rows) margin has no
122 # constraints, we need to make all such instances in the grid
123 # match in margin size.
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:389, in make_layout_margins(layoutgrids, fig, renderer, w_pad, h_pad, hspace, wspace)
385 return
387 margin = get_margin_from_padding(ax, w_pad=w_pad, h_pad=h_pad,
388 hspace=hspace, wspace=wspace)
--> 389 pos, bbox = get_pos_and_bbox(ax, renderer)
390 # the margin is the distance between the bounding box of the Axes
391 # and its position (plus the padding from above)
392 margin['left'] += pos.x0 - bbox.x0
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:637, in get_pos_and_bbox(ax, renderer)
635 # pos is in panel co-ords, but we need in figure for the layout
636 pos = pos.transformed(fig.transSubfigure - fig.transFigure)
--> 637 tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer)
638 if tightbbox is None:
639 bbox = pos
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axes/_base.py:4758, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4756 if self.axison and axis.get_visible():
4757 if for_layout_only:
-> 4758 ba = martist._get_tightbbox_for_layout_only(axis, renderer)
4759 else:
4760 ba = axis.get_tightbbox(renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1427, in Axis.get_tightbbox(self, renderer, for_layout_only)
1424 renderer = self.get_figure(root=True)._get_renderer()
1425 ticks_to_draw = self._update_ticks()
-> 1427 self._update_label_position(renderer)
1429 # go back to just this axis's tick labels
1430 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2615, in XAxis._update_label_position(self, renderer)
2611 return
2613 # get bounding boxes for this axis and any siblings
2614 # that have been set by `fig.align_xlabels()`
-> 2615 bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
2616 x, y = self.label.get_position()
2618 if self.label_position == 'bottom':
2619 # Union with extents of the bottom spine if present, of the axes otherwise.
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2403, in Axis._get_tick_boxes_siblings(self, renderer)
2401 axis = ax._axis_map[name]
2402 ticks_to_draw = axis._update_ticks()
-> 2403 tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
2404 bboxes.extend(tlb)
2405 bboxes2.extend(tlb2)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1404, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
1402 def _get_ticklabel_bboxes(self, ticks, renderer):
1403 """Return lists of bboxes for ticks' label1's and label2's."""
-> 1404 return ([tick.label1.get_window_extent(renderer)
1405 for tick in ticks
1406 if tick.label1.get_visible() and tick.label1.get_in_layout()],
1407 [tick.label2.get_window_extent(renderer)
1408 for tick in ticks
1409 if tick.label2.get_visible() and tick.label2.get_in_layout()])
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:1076, in Text.get_window_extent(self, renderer, dpi)
1071 raise RuntimeError(
1072 "Cannot get window extent of text w/o renderer. You likely "
1073 "want to call 'figure.draw_without_rendering()' first.")
1075 with cbook._setattr_cm(fig, dpi=dpi):
-> 1076 bbox, _, _ = self._get_layout(self._renderer)
1077 x, y = self.get_unitless_position()
1078 x, y = self.get_transform().transform((x, y))
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:465, in Text._get_layout(self, renderer)
462 break
463 if None in (min_ascent, min_descent):
464 # Fallback to font measurement.
--> 465 _, h, min_descent = _get_text_metrics_with_cache(
466 renderer, "lp", self._fontproperties,
467 ismath="TeX" if self.get_usetex() else False,
468 dpi=dpi)
469 min_ascent = h - min_descent
470 line_gap = 0
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:59, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
52 get_text_metrics = _get_text_metrics_function(renderer)
53 # call the function to compute the metrics and return
54 #
55 # We pass a copy of the fontprop because FontProperties is both mutable and
56 # has a `__hash__` that depends on that mutable state. This is not ideal
57 # as it means the hash of an object is not stable over time which leads to
58 # very confusing behavior when used as keys in dictionaries or hashes.
---> 59 return get_text_metrics(text, fontprop.copy(), ismath, dpi)
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:125, in _get_text_metrics_function.<locals>._text_metrics(text, fontprop, ismath, dpi)
120 raise RuntimeError(
121 "Trying to get text metrics for a renderer that no longer exists. "
122 "This should never happen and is evidence of a bug elsewhere."
123 )
124 # do the actual method call we need and return the result
--> 125 return local_renderer.get_text_width_height_descent(text, fontprop, ismath)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:256, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
254 _api.check_in_list(["TeX", True, False], ismath=ismath)
255 if ismath == "TeX":
--> 256 return super().get_text_width_height_descent(s, prop, ismath)
258 if ismath:
259 parse = self.mathtext_parser.parse(s, self.dpi, prop)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:589, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
585 fontsize = prop.get_size_in_points()
587 if ismath == 'TeX':
588 # todo: handle properties
--> 589 return self.get_texmanager().get_text_width_height_descent(
590 s, fontsize, renderer=self)
592 dpi = self.points_to_pixels(72)
593 if ismath:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:369, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
367 if tex.strip() == '':
368 return 0, 0, 0
--> 369 dvipath = cls.make_dvi(tex, fontsize)
370 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
371 with dviread.Dvi(dvipath, 72 * dpi_fraction) as dvi:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:301, in TexManager.make_dvi(cls, tex, fontsize)
298 with TemporaryDirectory(dir=dvipath.parent) as tmpdir:
299 Path(tmpdir, "file.tex").write_text(
300 cls._get_tex_source(tex, fontsize), encoding='utf-8')
--> 301 cls._run_checked_subprocess(
302 ["latex", "-interaction=nonstopmode", "-halt-on-error",
303 "-no-shell-escape", "file.tex"], tex, cwd=tmpdir)
304 Path(tmpdir, "file.dvi").replace(dvipath)
305 # Also move the tex source to the main cache directory, but
306 # only for backcompat.
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:274, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
262 raise RuntimeError(
263 '{prog} was not able to process the following string:\n'
264 '{tex!r}\n\n'
(...) 271 exc=exc.output.decode('utf-8', 'backslashreplace'))
272 ) from None
273 except (FileNotFoundError, OSError) as exc:
--> 274 raise RuntimeError(
275 f'Failed to process string with tex because {command[0]} '
276 'could not be found') from exc
277 _log.debug(report)
278 return report
RuntimeError: Failed to process string with tex because latex could not be found
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
257 try:
--> 258 report = subprocess.check_output(
259 command, cwd=cwd if cwd is not None else cls._cache_dir,
260 stderr=subprocess.STDOUT)
261 except subprocess.CalledProcessError as exc:
File /usr/local/lib/python3.14/subprocess.py:473, in check_output(timeout, *popenargs, **kwargs)
471 kwargs['input'] = empty
--> 473 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
474 **kwargs).stdout
File /usr/local/lib/python3.14/subprocess.py:555, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
553 kwargs['stderr'] = PIPE
--> 555 with Popen(*popenargs, **kwargs) as process:
556 try:
File /usr/local/lib/python3.14/subprocess.py:1039, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1036 self.stderr = io.TextIOWrapper(self.stderr,
1037 encoding=encoding, errors=errors)
-> 1039 self._execute_child(args, executable, preexec_fn, close_fds,
1040 pass_fds, cwd, env,
1041 startupinfo, creationflags, shell,
1042 p2cread, p2cwrite,
1043 c2pread, c2pwrite,
1044 errread, errwrite,
1045 restore_signals,
1046 gid, gids, uid, umask,
1047 start_new_session, process_group)
1048 except:
1049 # Cleanup if the child failed starting.
File /usr/local/lib/python3.14/subprocess.py:1990, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
1989 if err_filename is not None:
-> 1990 raise child_exception_type(errno_num, err_msg, err_filename)
1991 else:
FileNotFoundError: [Errno 2] No such file or directory: 'latex'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:2257, in FigureCanvasBase.print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)
2254 # we do this instead of `self.figure.draw_without_rendering`
2255 # so that we can inject the orientation
2256 with getattr(renderer, "_draw_disabled", nullcontext)():
-> 2257 self.figure.draw(renderer)
2258 else:
2259 renderer = None
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:94, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
92 @wraps(draw)
93 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 94 result = draw(artist, renderer, *args, **kwargs)
95 if renderer._rasterizing:
96 renderer.stop_rasterizing()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:71, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
68 if artist.get_agg_filter() is not None:
69 renderer.start_filter()
---> 71 return draw(artist, renderer)
72 finally:
73 if artist.get_agg_filter() is not None:
File /usr/local/lib/python3.14/site-packages/matplotlib/figure.py:3276, in Figure.draw(self, renderer)
3274 if self.axes and self.get_layout_engine() is not None:
3275 try:
-> 3276 self.get_layout_engine().execute(self)
3277 except ValueError:
3278 pass
File /usr/local/lib/python3.14/site-packages/matplotlib/layout_engine.py:278, in ConstrainedLayoutEngine.execute(self, fig)
275 w_pad = self._params['w_pad'] / width
276 h_pad = self._params['h_pad'] / height
--> 278 return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
279 wspace=self._params['wspace'],
280 hspace=self._params['hspace'],
281 rect=self._params['rect'],
282 compress=self._compress)
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:116, in do_constrained_layout(fig, h_pad, w_pad, hspace, wspace, rect, compress)
106 return
108 for _ in range(2):
109 # do the algorithm twice. This has to be done because decorations
110 # change size after the first re-position (i.e. x/yticklabels get
(...) 114 # make margins for all the Axes and subfigures in the
115 # figure. Add margins for colorbars...
--> 116 make_layout_margins(layoutgrids, fig, renderer, h_pad=h_pad,
117 w_pad=w_pad, hspace=hspace, wspace=wspace)
118 make_margin_suptitles(layoutgrids, fig, renderer, h_pad=h_pad,
119 w_pad=w_pad)
121 # if a layout is such that a columns (or rows) margin has no
122 # constraints, we need to make all such instances in the grid
123 # match in margin size.
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:389, in make_layout_margins(layoutgrids, fig, renderer, w_pad, h_pad, hspace, wspace)
385 return
387 margin = get_margin_from_padding(ax, w_pad=w_pad, h_pad=h_pad,
388 hspace=hspace, wspace=wspace)
--> 389 pos, bbox = get_pos_and_bbox(ax, renderer)
390 # the margin is the distance between the bounding box of the Axes
391 # and its position (plus the padding from above)
392 margin['left'] += pos.x0 - bbox.x0
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:637, in get_pos_and_bbox(ax, renderer)
635 # pos is in panel co-ords, but we need in figure for the layout
636 pos = pos.transformed(fig.transSubfigure - fig.transFigure)
--> 637 tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer)
638 if tightbbox is None:
639 bbox = pos
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axes/_base.py:4758, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4756 if self.axison and axis.get_visible():
4757 if for_layout_only:
-> 4758 ba = martist._get_tightbbox_for_layout_only(axis, renderer)
4759 else:
4760 ba = axis.get_tightbbox(renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1427, in Axis.get_tightbbox(self, renderer, for_layout_only)
1424 renderer = self.get_figure(root=True)._get_renderer()
1425 ticks_to_draw = self._update_ticks()
-> 1427 self._update_label_position(renderer)
1429 # go back to just this axis's tick labels
1430 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2615, in XAxis._update_label_position(self, renderer)
2611 return
2613 # get bounding boxes for this axis and any siblings
2614 # that have been set by `fig.align_xlabels()`
-> 2615 bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
2616 x, y = self.label.get_position()
2618 if self.label_position == 'bottom':
2619 # Union with extents of the bottom spine if present, of the axes otherwise.
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2403, in Axis._get_tick_boxes_siblings(self, renderer)
2401 axis = ax._axis_map[name]
2402 ticks_to_draw = axis._update_ticks()
-> 2403 tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
2404 bboxes.extend(tlb)
2405 bboxes2.extend(tlb2)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1404, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
1402 def _get_ticklabel_bboxes(self, ticks, renderer):
1403 """Return lists of bboxes for ticks' label1's and label2's."""
-> 1404 return ([tick.label1.get_window_extent(renderer)
1405 for tick in ticks
1406 if tick.label1.get_visible() and tick.label1.get_in_layout()],
1407 [tick.label2.get_window_extent(renderer)
1408 for tick in ticks
1409 if tick.label2.get_visible() and tick.label2.get_in_layout()])
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:1076, in Text.get_window_extent(self, renderer, dpi)
1071 raise RuntimeError(
1072 "Cannot get window extent of text w/o renderer. You likely "
1073 "want to call 'figure.draw_without_rendering()' first.")
1075 with cbook._setattr_cm(fig, dpi=dpi):
-> 1076 bbox, _, _ = self._get_layout(self._renderer)
1077 x, y = self.get_unitless_position()
1078 x, y = self.get_transform().transform((x, y))
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:465, in Text._get_layout(self, renderer)
462 break
463 if None in (min_ascent, min_descent):
464 # Fallback to font measurement.
--> 465 _, h, min_descent = _get_text_metrics_with_cache(
466 renderer, "lp", self._fontproperties,
467 ismath="TeX" if self.get_usetex() else False,
468 dpi=dpi)
469 min_ascent = h - min_descent
470 line_gap = 0
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:59, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
52 get_text_metrics = _get_text_metrics_function(renderer)
53 # call the function to compute the metrics and return
54 #
55 # We pass a copy of the fontprop because FontProperties is both mutable and
56 # has a `__hash__` that depends on that mutable state. This is not ideal
57 # as it means the hash of an object is not stable over time which leads to
58 # very confusing behavior when used as keys in dictionaries or hashes.
---> 59 return get_text_metrics(text, fontprop.copy(), ismath, dpi)
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:125, in _get_text_metrics_function.<locals>._text_metrics(text, fontprop, ismath, dpi)
120 raise RuntimeError(
121 "Trying to get text metrics for a renderer that no longer exists. "
122 "This should never happen and is evidence of a bug elsewhere."
123 )
124 # do the actual method call we need and return the result
--> 125 return local_renderer.get_text_width_height_descent(text, fontprop, ismath)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:256, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
254 _api.check_in_list(["TeX", True, False], ismath=ismath)
255 if ismath == "TeX":
--> 256 return super().get_text_width_height_descent(s, prop, ismath)
258 if ismath:
259 parse = self.mathtext_parser.parse(s, self.dpi, prop)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:589, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
585 fontsize = prop.get_size_in_points()
587 if ismath == 'TeX':
588 # todo: handle properties
--> 589 return self.get_texmanager().get_text_width_height_descent(
590 s, fontsize, renderer=self)
592 dpi = self.points_to_pixels(72)
593 if ismath:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:369, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
367 if tex.strip() == '':
368 return 0, 0, 0
--> 369 dvipath = cls.make_dvi(tex, fontsize)
370 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
371 with dviread.Dvi(dvipath, 72 * dpi_fraction) as dvi:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:301, in TexManager.make_dvi(cls, tex, fontsize)
298 with TemporaryDirectory(dir=dvipath.parent) as tmpdir:
299 Path(tmpdir, "file.tex").write_text(
300 cls._get_tex_source(tex, fontsize), encoding='utf-8')
--> 301 cls._run_checked_subprocess(
302 ["latex", "-interaction=nonstopmode", "-halt-on-error",
303 "-no-shell-escape", "file.tex"], tex, cwd=tmpdir)
304 Path(tmpdir, "file.dvi").replace(dvipath)
305 # Also move the tex source to the main cache directory, but
306 # only for backcompat.
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:274, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
262 raise RuntimeError(
263 '{prog} was not able to process the following string:\n'
264 '{tex!r}\n\n'
(...) 271 exc=exc.output.decode('utf-8', 'backslashreplace'))
272 ) from None
273 except (FileNotFoundError, OSError) as exc:
--> 274 raise RuntimeError(
275 f'Failed to process string with tex because {command[0]} '
276 'could not be found') from exc
277 _log.debug(report)
278 return report
RuntimeError: Failed to process string with tex because latex could not be found
<Figure size 600x300 with 2 Axes>
pyxla.distr_Par() gives an idea of how solutions rank against each other when the objective and the violation values are subjected to Pareto ranking.
Correlation among objective and violations and their ranks¶
from pyxla import corr, corr_ranks
corr, plot = corr(sphere_sample)
corr
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:524: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(FV_feas[x], FV_feas[y])
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:524: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(FV_feas[x], FV_feas[y])
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:524: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(FV_feas[x], FV_feas[y])
{'f0_v0_feasible': np.float64(nan),
'f0_v0_infeasible': np.float64(0.9971016655579251),
'f0_v1_feasible': np.float64(nan),
'f0_v1_infeasible': np.float64(-0.08610832478152008),
'v0_v1_feasible': np.float64(nan),
'v0_v1_infeasible': np.float64(-0.08454319359436449)}
Error in callback <function _draw_all_if_interactive at 0x79ab71c76e50> (for post_execute), with arguments args (),kwargs {}:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
257 try:
--> 258 report = subprocess.check_output(
259 command, cwd=cwd if cwd is not None else cls._cache_dir,
260 stderr=subprocess.STDOUT)
261 except subprocess.CalledProcessError as exc:
File /usr/local/lib/python3.14/subprocess.py:473, in check_output(timeout, *popenargs, **kwargs)
471 kwargs['input'] = empty
--> 473 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
474 **kwargs).stdout
File /usr/local/lib/python3.14/subprocess.py:555, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
553 kwargs['stderr'] = PIPE
--> 555 with Popen(*popenargs, **kwargs) as process:
556 try:
File /usr/local/lib/python3.14/subprocess.py:1039, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1036 self.stderr = io.TextIOWrapper(self.stderr,
1037 encoding=encoding, errors=errors)
-> 1039 self._execute_child(args, executable, preexec_fn, close_fds,
1040 pass_fds, cwd, env,
1041 startupinfo, creationflags, shell,
1042 p2cread, p2cwrite,
1043 c2pread, c2pwrite,
1044 errread, errwrite,
1045 restore_signals,
1046 gid, gids, uid, umask,
1047 start_new_session, process_group)
1048 except:
1049 # Cleanup if the child failed starting.
File /usr/local/lib/python3.14/subprocess.py:1990, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
1989 if err_filename is not None:
-> 1990 raise child_exception_type(errno_num, err_msg, err_filename)
1991 else:
FileNotFoundError: [Errno 2] No such file or directory: 'latex'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/pyplot.py:300, in _draw_all_if_interactive()
298 def _draw_all_if_interactive() -> None:
299 if matplotlib.is_interactive():
--> 300 draw_all()
File /usr/local/lib/python3.14/site-packages/matplotlib/_pylab_helpers.py:133, in Gcf.draw_all(cls, force)
131 for manager in cls.get_all_fig_managers():
132 if force or manager.canvas.figure.stale:
--> 133 manager.canvas.draw_idle()
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:1989, in FigureCanvasBase.draw_idle(self, *args, **kwargs)
1987 if not self._is_idle_drawing:
1988 with self._idle_draw_cntx():
-> 1989 self.draw(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:438, in FigureCanvasAgg.draw(self)
435 # Acquire a lock on the shared font cache.
436 with (self.toolbar._wait_cursor_for_draw_cm() if self.toolbar
437 else nullcontext()):
--> 438 self.figure.draw(self.renderer)
439 # A GUI class may be need to update a window using this draw, so
440 # don't forget to call the superclass.
441 super().draw()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:94, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
92 @wraps(draw)
93 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 94 result = draw(artist, renderer, *args, **kwargs)
95 if renderer._rasterizing:
96 renderer.stop_rasterizing()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:71, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
68 if artist.get_agg_filter() is not None:
69 renderer.start_filter()
---> 71 return draw(artist, renderer)
72 finally:
73 if artist.get_agg_filter() is not None:
File /usr/local/lib/python3.14/site-packages/matplotlib/figure.py:3276, in Figure.draw(self, renderer)
3274 if self.axes and self.get_layout_engine() is not None:
3275 try:
-> 3276 self.get_layout_engine().execute(self)
3277 except ValueError:
3278 pass
File /usr/local/lib/python3.14/site-packages/matplotlib/layout_engine.py:278, in ConstrainedLayoutEngine.execute(self, fig)
275 w_pad = self._params['w_pad'] / width
276 h_pad = self._params['h_pad'] / height
--> 278 return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
279 wspace=self._params['wspace'],
280 hspace=self._params['hspace'],
281 rect=self._params['rect'],
282 compress=self._compress)
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:116, in do_constrained_layout(fig, h_pad, w_pad, hspace, wspace, rect, compress)
106 return
108 for _ in range(2):
109 # do the algorithm twice. This has to be done because decorations
110 # change size after the first re-position (i.e. x/yticklabels get
(...) 114 # make margins for all the Axes and subfigures in the
115 # figure. Add margins for colorbars...
--> 116 make_layout_margins(layoutgrids, fig, renderer, h_pad=h_pad,
117 w_pad=w_pad, hspace=hspace, wspace=wspace)
118 make_margin_suptitles(layoutgrids, fig, renderer, h_pad=h_pad,
119 w_pad=w_pad)
121 # if a layout is such that a columns (or rows) margin has no
122 # constraints, we need to make all such instances in the grid
123 # match in margin size.
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:389, in make_layout_margins(layoutgrids, fig, renderer, w_pad, h_pad, hspace, wspace)
385 return
387 margin = get_margin_from_padding(ax, w_pad=w_pad, h_pad=h_pad,
388 hspace=hspace, wspace=wspace)
--> 389 pos, bbox = get_pos_and_bbox(ax, renderer)
390 # the margin is the distance between the bounding box of the Axes
391 # and its position (plus the padding from above)
392 margin['left'] += pos.x0 - bbox.x0
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:637, in get_pos_and_bbox(ax, renderer)
635 # pos is in panel co-ords, but we need in figure for the layout
636 pos = pos.transformed(fig.transSubfigure - fig.transFigure)
--> 637 tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer)
638 if tightbbox is None:
639 bbox = pos
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axes/_base.py:4758, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4756 if self.axison and axis.get_visible():
4757 if for_layout_only:
-> 4758 ba = martist._get_tightbbox_for_layout_only(axis, renderer)
4759 else:
4760 ba = axis.get_tightbbox(renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1427, in Axis.get_tightbbox(self, renderer, for_layout_only)
1424 renderer = self.get_figure(root=True)._get_renderer()
1425 ticks_to_draw = self._update_ticks()
-> 1427 self._update_label_position(renderer)
1429 # go back to just this axis's tick labels
1430 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2615, in XAxis._update_label_position(self, renderer)
2611 return
2613 # get bounding boxes for this axis and any siblings
2614 # that have been set by `fig.align_xlabels()`
-> 2615 bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
2616 x, y = self.label.get_position()
2618 if self.label_position == 'bottom':
2619 # Union with extents of the bottom spine if present, of the axes otherwise.
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2403, in Axis._get_tick_boxes_siblings(self, renderer)
2401 axis = ax._axis_map[name]
2402 ticks_to_draw = axis._update_ticks()
-> 2403 tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
2404 bboxes.extend(tlb)
2405 bboxes2.extend(tlb2)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1404, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
1402 def _get_ticklabel_bboxes(self, ticks, renderer):
1403 """Return lists of bboxes for ticks' label1's and label2's."""
-> 1404 return ([tick.label1.get_window_extent(renderer)
1405 for tick in ticks
1406 if tick.label1.get_visible() and tick.label1.get_in_layout()],
1407 [tick.label2.get_window_extent(renderer)
1408 for tick in ticks
1409 if tick.label2.get_visible() and tick.label2.get_in_layout()])
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:1076, in Text.get_window_extent(self, renderer, dpi)
1071 raise RuntimeError(
1072 "Cannot get window extent of text w/o renderer. You likely "
1073 "want to call 'figure.draw_without_rendering()' first.")
1075 with cbook._setattr_cm(fig, dpi=dpi):
-> 1076 bbox, _, _ = self._get_layout(self._renderer)
1077 x, y = self.get_unitless_position()
1078 x, y = self.get_transform().transform((x, y))
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:465, in Text._get_layout(self, renderer)
462 break
463 if None in (min_ascent, min_descent):
464 # Fallback to font measurement.
--> 465 _, h, min_descent = _get_text_metrics_with_cache(
466 renderer, "lp", self._fontproperties,
467 ismath="TeX" if self.get_usetex() else False,
468 dpi=dpi)
469 min_ascent = h - min_descent
470 line_gap = 0
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:59, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
52 get_text_metrics = _get_text_metrics_function(renderer)
53 # call the function to compute the metrics and return
54 #
55 # We pass a copy of the fontprop because FontProperties is both mutable and
56 # has a `__hash__` that depends on that mutable state. This is not ideal
57 # as it means the hash of an object is not stable over time which leads to
58 # very confusing behavior when used as keys in dictionaries or hashes.
---> 59 return get_text_metrics(text, fontprop.copy(), ismath, dpi)
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:125, in _get_text_metrics_function.<locals>._text_metrics(text, fontprop, ismath, dpi)
120 raise RuntimeError(
121 "Trying to get text metrics for a renderer that no longer exists. "
122 "This should never happen and is evidence of a bug elsewhere."
123 )
124 # do the actual method call we need and return the result
--> 125 return local_renderer.get_text_width_height_descent(text, fontprop, ismath)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:256, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
254 _api.check_in_list(["TeX", True, False], ismath=ismath)
255 if ismath == "TeX":
--> 256 return super().get_text_width_height_descent(s, prop, ismath)
258 if ismath:
259 parse = self.mathtext_parser.parse(s, self.dpi, prop)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:589, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
585 fontsize = prop.get_size_in_points()
587 if ismath == 'TeX':
588 # todo: handle properties
--> 589 return self.get_texmanager().get_text_width_height_descent(
590 s, fontsize, renderer=self)
592 dpi = self.points_to_pixels(72)
593 if ismath:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:369, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
367 if tex.strip() == '':
368 return 0, 0, 0
--> 369 dvipath = cls.make_dvi(tex, fontsize)
370 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
371 with dviread.Dvi(dvipath, 72 * dpi_fraction) as dvi:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:301, in TexManager.make_dvi(cls, tex, fontsize)
298 with TemporaryDirectory(dir=dvipath.parent) as tmpdir:
299 Path(tmpdir, "file.tex").write_text(
300 cls._get_tex_source(tex, fontsize), encoding='utf-8')
--> 301 cls._run_checked_subprocess(
302 ["latex", "-interaction=nonstopmode", "-halt-on-error",
303 "-no-shell-escape", "file.tex"], tex, cwd=tmpdir)
304 Path(tmpdir, "file.dvi").replace(dvipath)
305 # Also move the tex source to the main cache directory, but
306 # only for backcompat.
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:274, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
262 raise RuntimeError(
263 '{prog} was not able to process the following string:\n'
264 '{tex!r}\n\n'
(...) 271 exc=exc.output.decode('utf-8', 'backslashreplace'))
272 ) from None
273 except (FileNotFoundError, OSError) as exc:
--> 274 raise RuntimeError(
275 f'Failed to process string with tex because {command[0]} '
276 'could not be found') from exc
277 _log.debug(report)
278 return report
RuntimeError: Failed to process string with tex because latex could not be found
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
257 try:
--> 258 report = subprocess.check_output(
259 command, cwd=cwd if cwd is not None else cls._cache_dir,
260 stderr=subprocess.STDOUT)
261 except subprocess.CalledProcessError as exc:
File /usr/local/lib/python3.14/subprocess.py:473, in check_output(timeout, *popenargs, **kwargs)
471 kwargs['input'] = empty
--> 473 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
474 **kwargs).stdout
File /usr/local/lib/python3.14/subprocess.py:555, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
553 kwargs['stderr'] = PIPE
--> 555 with Popen(*popenargs, **kwargs) as process:
556 try:
File /usr/local/lib/python3.14/subprocess.py:1039, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1036 self.stderr = io.TextIOWrapper(self.stderr,
1037 encoding=encoding, errors=errors)
-> 1039 self._execute_child(args, executable, preexec_fn, close_fds,
1040 pass_fds, cwd, env,
1041 startupinfo, creationflags, shell,
1042 p2cread, p2cwrite,
1043 c2pread, c2pwrite,
1044 errread, errwrite,
1045 restore_signals,
1046 gid, gids, uid, umask,
1047 start_new_session, process_group)
1048 except:
1049 # Cleanup if the child failed starting.
File /usr/local/lib/python3.14/subprocess.py:1990, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
1989 if err_filename is not None:
-> 1990 raise child_exception_type(errno_num, err_msg, err_filename)
1991 else:
FileNotFoundError: [Errno 2] No such file or directory: 'latex'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:2257, in FigureCanvasBase.print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)
2254 # we do this instead of `self.figure.draw_without_rendering`
2255 # so that we can inject the orientation
2256 with getattr(renderer, "_draw_disabled", nullcontext)():
-> 2257 self.figure.draw(renderer)
2258 else:
2259 renderer = None
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:94, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
92 @wraps(draw)
93 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 94 result = draw(artist, renderer, *args, **kwargs)
95 if renderer._rasterizing:
96 renderer.stop_rasterizing()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:71, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
68 if artist.get_agg_filter() is not None:
69 renderer.start_filter()
---> 71 return draw(artist, renderer)
72 finally:
73 if artist.get_agg_filter() is not None:
File /usr/local/lib/python3.14/site-packages/matplotlib/figure.py:3276, in Figure.draw(self, renderer)
3274 if self.axes and self.get_layout_engine() is not None:
3275 try:
-> 3276 self.get_layout_engine().execute(self)
3277 except ValueError:
3278 pass
File /usr/local/lib/python3.14/site-packages/matplotlib/layout_engine.py:278, in ConstrainedLayoutEngine.execute(self, fig)
275 w_pad = self._params['w_pad'] / width
276 h_pad = self._params['h_pad'] / height
--> 278 return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
279 wspace=self._params['wspace'],
280 hspace=self._params['hspace'],
281 rect=self._params['rect'],
282 compress=self._compress)
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:116, in do_constrained_layout(fig, h_pad, w_pad, hspace, wspace, rect, compress)
106 return
108 for _ in range(2):
109 # do the algorithm twice. This has to be done because decorations
110 # change size after the first re-position (i.e. x/yticklabels get
(...) 114 # make margins for all the Axes and subfigures in the
115 # figure. Add margins for colorbars...
--> 116 make_layout_margins(layoutgrids, fig, renderer, h_pad=h_pad,
117 w_pad=w_pad, hspace=hspace, wspace=wspace)
118 make_margin_suptitles(layoutgrids, fig, renderer, h_pad=h_pad,
119 w_pad=w_pad)
121 # if a layout is such that a columns (or rows) margin has no
122 # constraints, we need to make all such instances in the grid
123 # match in margin size.
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:389, in make_layout_margins(layoutgrids, fig, renderer, w_pad, h_pad, hspace, wspace)
385 return
387 margin = get_margin_from_padding(ax, w_pad=w_pad, h_pad=h_pad,
388 hspace=hspace, wspace=wspace)
--> 389 pos, bbox = get_pos_and_bbox(ax, renderer)
390 # the margin is the distance between the bounding box of the Axes
391 # and its position (plus the padding from above)
392 margin['left'] += pos.x0 - bbox.x0
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:637, in get_pos_and_bbox(ax, renderer)
635 # pos is in panel co-ords, but we need in figure for the layout
636 pos = pos.transformed(fig.transSubfigure - fig.transFigure)
--> 637 tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer)
638 if tightbbox is None:
639 bbox = pos
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axes/_base.py:4758, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4756 if self.axison and axis.get_visible():
4757 if for_layout_only:
-> 4758 ba = martist._get_tightbbox_for_layout_only(axis, renderer)
4759 else:
4760 ba = axis.get_tightbbox(renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1427, in Axis.get_tightbbox(self, renderer, for_layout_only)
1424 renderer = self.get_figure(root=True)._get_renderer()
1425 ticks_to_draw = self._update_ticks()
-> 1427 self._update_label_position(renderer)
1429 # go back to just this axis's tick labels
1430 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2615, in XAxis._update_label_position(self, renderer)
2611 return
2613 # get bounding boxes for this axis and any siblings
2614 # that have been set by `fig.align_xlabels()`
-> 2615 bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
2616 x, y = self.label.get_position()
2618 if self.label_position == 'bottom':
2619 # Union with extents of the bottom spine if present, of the axes otherwise.
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2403, in Axis._get_tick_boxes_siblings(self, renderer)
2401 axis = ax._axis_map[name]
2402 ticks_to_draw = axis._update_ticks()
-> 2403 tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
2404 bboxes.extend(tlb)
2405 bboxes2.extend(tlb2)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1404, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
1402 def _get_ticklabel_bboxes(self, ticks, renderer):
1403 """Return lists of bboxes for ticks' label1's and label2's."""
-> 1404 return ([tick.label1.get_window_extent(renderer)
1405 for tick in ticks
1406 if tick.label1.get_visible() and tick.label1.get_in_layout()],
1407 [tick.label2.get_window_extent(renderer)
1408 for tick in ticks
1409 if tick.label2.get_visible() and tick.label2.get_in_layout()])
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:1076, in Text.get_window_extent(self, renderer, dpi)
1071 raise RuntimeError(
1072 "Cannot get window extent of text w/o renderer. You likely "
1073 "want to call 'figure.draw_without_rendering()' first.")
1075 with cbook._setattr_cm(fig, dpi=dpi):
-> 1076 bbox, _, _ = self._get_layout(self._renderer)
1077 x, y = self.get_unitless_position()
1078 x, y = self.get_transform().transform((x, y))
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:465, in Text._get_layout(self, renderer)
462 break
463 if None in (min_ascent, min_descent):
464 # Fallback to font measurement.
--> 465 _, h, min_descent = _get_text_metrics_with_cache(
466 renderer, "lp", self._fontproperties,
467 ismath="TeX" if self.get_usetex() else False,
468 dpi=dpi)
469 min_ascent = h - min_descent
470 line_gap = 0
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:59, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
52 get_text_metrics = _get_text_metrics_function(renderer)
53 # call the function to compute the metrics and return
54 #
55 # We pass a copy of the fontprop because FontProperties is both mutable and
56 # has a `__hash__` that depends on that mutable state. This is not ideal
57 # as it means the hash of an object is not stable over time which leads to
58 # very confusing behavior when used as keys in dictionaries or hashes.
---> 59 return get_text_metrics(text, fontprop.copy(), ismath, dpi)
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:125, in _get_text_metrics_function.<locals>._text_metrics(text, fontprop, ismath, dpi)
120 raise RuntimeError(
121 "Trying to get text metrics for a renderer that no longer exists. "
122 "This should never happen and is evidence of a bug elsewhere."
123 )
124 # do the actual method call we need and return the result
--> 125 return local_renderer.get_text_width_height_descent(text, fontprop, ismath)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:256, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
254 _api.check_in_list(["TeX", True, False], ismath=ismath)
255 if ismath == "TeX":
--> 256 return super().get_text_width_height_descent(s, prop, ismath)
258 if ismath:
259 parse = self.mathtext_parser.parse(s, self.dpi, prop)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:589, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
585 fontsize = prop.get_size_in_points()
587 if ismath == 'TeX':
588 # todo: handle properties
--> 589 return self.get_texmanager().get_text_width_height_descent(
590 s, fontsize, renderer=self)
592 dpi = self.points_to_pixels(72)
593 if ismath:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:369, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
367 if tex.strip() == '':
368 return 0, 0, 0
--> 369 dvipath = cls.make_dvi(tex, fontsize)
370 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
371 with dviread.Dvi(dvipath, 72 * dpi_fraction) as dvi:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:301, in TexManager.make_dvi(cls, tex, fontsize)
298 with TemporaryDirectory(dir=dvipath.parent) as tmpdir:
299 Path(tmpdir, "file.tex").write_text(
300 cls._get_tex_source(tex, fontsize), encoding='utf-8')
--> 301 cls._run_checked_subprocess(
302 ["latex", "-interaction=nonstopmode", "-halt-on-error",
303 "-no-shell-escape", "file.tex"], tex, cwd=tmpdir)
304 Path(tmpdir, "file.dvi").replace(dvipath)
305 # Also move the tex source to the main cache directory, but
306 # only for backcompat.
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:274, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
262 raise RuntimeError(
263 '{prog} was not able to process the following string:\n'
264 '{tex!r}\n\n'
(...) 271 exc=exc.output.decode('utf-8', 'backslashreplace'))
272 ) from None
273 except (FileNotFoundError, OSError) as exc:
--> 274 raise RuntimeError(
275 f'Failed to process string with tex because {command[0]} '
276 'could not be found') from exc
277 _log.debug(report)
278 return report
RuntimeError: Failed to process string with tex because latex could not be found
<Figure size 900x300 with 3 Axes>
As expected the Equation (2) constraint is correlation with the objective (sphere function) and the Equation (3) constraint is not.
corr, plot = corr_ranks(sphere_sample)
corr
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:636: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(R_feas[x], R_feas[y])
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:636: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(R_feas[x], R_feas[y])
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:636: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(R_feas[x], R_feas[y])
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:636: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(R_feas[x], R_feas[y])
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:636: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(R_feas[x], R_feas[y])
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:636: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(R_feas[x], R_feas[y])
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:636: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(R_feas[x], R_feas[y])
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:636: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(R_feas[x], R_feas[y])
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:636: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(R_feas[x], R_feas[y])
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:636: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(R_feas[x], R_feas[y])
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:636: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(R_feas[x], R_feas[y])
/builds/aliefooghe/pyxla/src/pyxla/__init__.py:636: ConstantInputWarning: An input array is constant; the correlation coefficient is not defined.
sp_corr_feas, _ = scipy.stats.spearmanr(R_feas[x], R_feas[y])
{'f0_v0_feasible': np.float64(nan),
'f0_v0_infeasible': np.float64(0.9971016655579251),
'f0_v1_feasible': np.float64(nan),
'f0_v1_infeasible': np.float64(-0.08610832478152008),
'f0_paretoV_feasible': np.float64(nan),
'f0_paretoV_infeasible': np.float64(0.9523266844866561),
'f0_Deb_feasible': np.float64(-1.0),
'f0_Deb_infeasible': np.float64(0.9473312365221845),
'f0_paretoFV_feasible': np.float64(1.0),
'f0_paretoFV_infeasible': np.float64(0.9994082794639906),
'v0_v1_feasible': np.float64(nan),
'v0_v1_infeasible': np.float64(-0.08454319359436449),
'v0_paretoV_feasible': np.float64(nan),
'v0_paretoV_infeasible': np.float64(0.9567900862254293),
'v0_Deb_feasible': np.float64(nan),
'v0_Deb_infeasible': np.float64(0.951689831135599),
'v0_paretoFV_feasible': np.float64(nan),
'v0_paretoFV_infeasible': np.float64(0.9965066184148563),
'v1_paretoV_feasible': np.float64(nan),
'v1_paretoV_infeasible': np.float64(0.09193209999288636),
'v1_Deb_feasible': np.float64(nan),
'v1_Deb_infeasible': np.float64(0.11291084135492355),
'v1_paretoFV_feasible': np.float64(nan),
'v1_paretoFV_infeasible': np.float64(-0.06456550323317042),
'paretoV_Deb_feasible': np.float64(nan),
'paretoV_Deb_infeasible': np.float64(0.9996168826881929),
'paretoV_paretoFV_feasible': np.float64(nan),
'paretoV_paretoFV_infeasible': np.float64(0.9545024836491274),
'Deb_paretoFV_feasible': np.float64(-1.0),
'Deb_paretoFV_infeasible': np.float64(0.9501562781940082)}
Error in callback <function _draw_all_if_interactive at 0x79ab71c76e50> (for post_execute), with arguments args (),kwargs {}:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
257 try:
--> 258 report = subprocess.check_output(
259 command, cwd=cwd if cwd is not None else cls._cache_dir,
260 stderr=subprocess.STDOUT)
261 except subprocess.CalledProcessError as exc:
File /usr/local/lib/python3.14/subprocess.py:473, in check_output(timeout, *popenargs, **kwargs)
471 kwargs['input'] = empty
--> 473 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
474 **kwargs).stdout
File /usr/local/lib/python3.14/subprocess.py:555, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
553 kwargs['stderr'] = PIPE
--> 555 with Popen(*popenargs, **kwargs) as process:
556 try:
File /usr/local/lib/python3.14/subprocess.py:1039, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1036 self.stderr = io.TextIOWrapper(self.stderr,
1037 encoding=encoding, errors=errors)
-> 1039 self._execute_child(args, executable, preexec_fn, close_fds,
1040 pass_fds, cwd, env,
1041 startupinfo, creationflags, shell,
1042 p2cread, p2cwrite,
1043 c2pread, c2pwrite,
1044 errread, errwrite,
1045 restore_signals,
1046 gid, gids, uid, umask,
1047 start_new_session, process_group)
1048 except:
1049 # Cleanup if the child failed starting.
File /usr/local/lib/python3.14/subprocess.py:1990, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
1989 if err_filename is not None:
-> 1990 raise child_exception_type(errno_num, err_msg, err_filename)
1991 else:
FileNotFoundError: [Errno 2] No such file or directory: 'latex'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/pyplot.py:300, in _draw_all_if_interactive()
298 def _draw_all_if_interactive() -> None:
299 if matplotlib.is_interactive():
--> 300 draw_all()
File /usr/local/lib/python3.14/site-packages/matplotlib/_pylab_helpers.py:133, in Gcf.draw_all(cls, force)
131 for manager in cls.get_all_fig_managers():
132 if force or manager.canvas.figure.stale:
--> 133 manager.canvas.draw_idle()
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:1989, in FigureCanvasBase.draw_idle(self, *args, **kwargs)
1987 if not self._is_idle_drawing:
1988 with self._idle_draw_cntx():
-> 1989 self.draw(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:438, in FigureCanvasAgg.draw(self)
435 # Acquire a lock on the shared font cache.
436 with (self.toolbar._wait_cursor_for_draw_cm() if self.toolbar
437 else nullcontext()):
--> 438 self.figure.draw(self.renderer)
439 # A GUI class may be need to update a window using this draw, so
440 # don't forget to call the superclass.
441 super().draw()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:94, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
92 @wraps(draw)
93 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 94 result = draw(artist, renderer, *args, **kwargs)
95 if renderer._rasterizing:
96 renderer.stop_rasterizing()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:71, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
68 if artist.get_agg_filter() is not None:
69 renderer.start_filter()
---> 71 return draw(artist, renderer)
72 finally:
73 if artist.get_agg_filter() is not None:
File /usr/local/lib/python3.14/site-packages/matplotlib/figure.py:3276, in Figure.draw(self, renderer)
3274 if self.axes and self.get_layout_engine() is not None:
3275 try:
-> 3276 self.get_layout_engine().execute(self)
3277 except ValueError:
3278 pass
File /usr/local/lib/python3.14/site-packages/matplotlib/layout_engine.py:278, in ConstrainedLayoutEngine.execute(self, fig)
275 w_pad = self._params['w_pad'] / width
276 h_pad = self._params['h_pad'] / height
--> 278 return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
279 wspace=self._params['wspace'],
280 hspace=self._params['hspace'],
281 rect=self._params['rect'],
282 compress=self._compress)
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:116, in do_constrained_layout(fig, h_pad, w_pad, hspace, wspace, rect, compress)
106 return
108 for _ in range(2):
109 # do the algorithm twice. This has to be done because decorations
110 # change size after the first re-position (i.e. x/yticklabels get
(...) 114 # make margins for all the Axes and subfigures in the
115 # figure. Add margins for colorbars...
--> 116 make_layout_margins(layoutgrids, fig, renderer, h_pad=h_pad,
117 w_pad=w_pad, hspace=hspace, wspace=wspace)
118 make_margin_suptitles(layoutgrids, fig, renderer, h_pad=h_pad,
119 w_pad=w_pad)
121 # if a layout is such that a columns (or rows) margin has no
122 # constraints, we need to make all such instances in the grid
123 # match in margin size.
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:389, in make_layout_margins(layoutgrids, fig, renderer, w_pad, h_pad, hspace, wspace)
385 return
387 margin = get_margin_from_padding(ax, w_pad=w_pad, h_pad=h_pad,
388 hspace=hspace, wspace=wspace)
--> 389 pos, bbox = get_pos_and_bbox(ax, renderer)
390 # the margin is the distance between the bounding box of the Axes
391 # and its position (plus the padding from above)
392 margin['left'] += pos.x0 - bbox.x0
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:637, in get_pos_and_bbox(ax, renderer)
635 # pos is in panel co-ords, but we need in figure for the layout
636 pos = pos.transformed(fig.transSubfigure - fig.transFigure)
--> 637 tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer)
638 if tightbbox is None:
639 bbox = pos
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axes/_base.py:4758, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4756 if self.axison and axis.get_visible():
4757 if for_layout_only:
-> 4758 ba = martist._get_tightbbox_for_layout_only(axis, renderer)
4759 else:
4760 ba = axis.get_tightbbox(renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1427, in Axis.get_tightbbox(self, renderer, for_layout_only)
1424 renderer = self.get_figure(root=True)._get_renderer()
1425 ticks_to_draw = self._update_ticks()
-> 1427 self._update_label_position(renderer)
1429 # go back to just this axis's tick labels
1430 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2615, in XAxis._update_label_position(self, renderer)
2611 return
2613 # get bounding boxes for this axis and any siblings
2614 # that have been set by `fig.align_xlabels()`
-> 2615 bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
2616 x, y = self.label.get_position()
2618 if self.label_position == 'bottom':
2619 # Union with extents of the bottom spine if present, of the axes otherwise.
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2403, in Axis._get_tick_boxes_siblings(self, renderer)
2401 axis = ax._axis_map[name]
2402 ticks_to_draw = axis._update_ticks()
-> 2403 tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
2404 bboxes.extend(tlb)
2405 bboxes2.extend(tlb2)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1404, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
1402 def _get_ticklabel_bboxes(self, ticks, renderer):
1403 """Return lists of bboxes for ticks' label1's and label2's."""
-> 1404 return ([tick.label1.get_window_extent(renderer)
1405 for tick in ticks
1406 if tick.label1.get_visible() and tick.label1.get_in_layout()],
1407 [tick.label2.get_window_extent(renderer)
1408 for tick in ticks
1409 if tick.label2.get_visible() and tick.label2.get_in_layout()])
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:1076, in Text.get_window_extent(self, renderer, dpi)
1071 raise RuntimeError(
1072 "Cannot get window extent of text w/o renderer. You likely "
1073 "want to call 'figure.draw_without_rendering()' first.")
1075 with cbook._setattr_cm(fig, dpi=dpi):
-> 1076 bbox, _, _ = self._get_layout(self._renderer)
1077 x, y = self.get_unitless_position()
1078 x, y = self.get_transform().transform((x, y))
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:465, in Text._get_layout(self, renderer)
462 break
463 if None in (min_ascent, min_descent):
464 # Fallback to font measurement.
--> 465 _, h, min_descent = _get_text_metrics_with_cache(
466 renderer, "lp", self._fontproperties,
467 ismath="TeX" if self.get_usetex() else False,
468 dpi=dpi)
469 min_ascent = h - min_descent
470 line_gap = 0
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:59, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
52 get_text_metrics = _get_text_metrics_function(renderer)
53 # call the function to compute the metrics and return
54 #
55 # We pass a copy of the fontprop because FontProperties is both mutable and
56 # has a `__hash__` that depends on that mutable state. This is not ideal
57 # as it means the hash of an object is not stable over time which leads to
58 # very confusing behavior when used as keys in dictionaries or hashes.
---> 59 return get_text_metrics(text, fontprop.copy(), ismath, dpi)
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:125, in _get_text_metrics_function.<locals>._text_metrics(text, fontprop, ismath, dpi)
120 raise RuntimeError(
121 "Trying to get text metrics for a renderer that no longer exists. "
122 "This should never happen and is evidence of a bug elsewhere."
123 )
124 # do the actual method call we need and return the result
--> 125 return local_renderer.get_text_width_height_descent(text, fontprop, ismath)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:256, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
254 _api.check_in_list(["TeX", True, False], ismath=ismath)
255 if ismath == "TeX":
--> 256 return super().get_text_width_height_descent(s, prop, ismath)
258 if ismath:
259 parse = self.mathtext_parser.parse(s, self.dpi, prop)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:589, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
585 fontsize = prop.get_size_in_points()
587 if ismath == 'TeX':
588 # todo: handle properties
--> 589 return self.get_texmanager().get_text_width_height_descent(
590 s, fontsize, renderer=self)
592 dpi = self.points_to_pixels(72)
593 if ismath:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:369, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
367 if tex.strip() == '':
368 return 0, 0, 0
--> 369 dvipath = cls.make_dvi(tex, fontsize)
370 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
371 with dviread.Dvi(dvipath, 72 * dpi_fraction) as dvi:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:301, in TexManager.make_dvi(cls, tex, fontsize)
298 with TemporaryDirectory(dir=dvipath.parent) as tmpdir:
299 Path(tmpdir, "file.tex").write_text(
300 cls._get_tex_source(tex, fontsize), encoding='utf-8')
--> 301 cls._run_checked_subprocess(
302 ["latex", "-interaction=nonstopmode", "-halt-on-error",
303 "-no-shell-escape", "file.tex"], tex, cwd=tmpdir)
304 Path(tmpdir, "file.dvi").replace(dvipath)
305 # Also move the tex source to the main cache directory, but
306 # only for backcompat.
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:274, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
262 raise RuntimeError(
263 '{prog} was not able to process the following string:\n'
264 '{tex!r}\n\n'
(...) 271 exc=exc.output.decode('utf-8', 'backslashreplace'))
272 ) from None
273 except (FileNotFoundError, OSError) as exc:
--> 274 raise RuntimeError(
275 f'Failed to process string with tex because {command[0]} '
276 'could not be found') from exc
277 _log.debug(report)
278 return report
RuntimeError: Failed to process string with tex because latex could not be found
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
257 try:
--> 258 report = subprocess.check_output(
259 command, cwd=cwd if cwd is not None else cls._cache_dir,
260 stderr=subprocess.STDOUT)
261 except subprocess.CalledProcessError as exc:
File /usr/local/lib/python3.14/subprocess.py:473, in check_output(timeout, *popenargs, **kwargs)
471 kwargs['input'] = empty
--> 473 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
474 **kwargs).stdout
File /usr/local/lib/python3.14/subprocess.py:555, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
553 kwargs['stderr'] = PIPE
--> 555 with Popen(*popenargs, **kwargs) as process:
556 try:
File /usr/local/lib/python3.14/subprocess.py:1039, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1036 self.stderr = io.TextIOWrapper(self.stderr,
1037 encoding=encoding, errors=errors)
-> 1039 self._execute_child(args, executable, preexec_fn, close_fds,
1040 pass_fds, cwd, env,
1041 startupinfo, creationflags, shell,
1042 p2cread, p2cwrite,
1043 c2pread, c2pwrite,
1044 errread, errwrite,
1045 restore_signals,
1046 gid, gids, uid, umask,
1047 start_new_session, process_group)
1048 except:
1049 # Cleanup if the child failed starting.
File /usr/local/lib/python3.14/subprocess.py:1990, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
1989 if err_filename is not None:
-> 1990 raise child_exception_type(errno_num, err_msg, err_filename)
1991 else:
FileNotFoundError: [Errno 2] No such file or directory: 'latex'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:2257, in FigureCanvasBase.print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)
2254 # we do this instead of `self.figure.draw_without_rendering`
2255 # so that we can inject the orientation
2256 with getattr(renderer, "_draw_disabled", nullcontext)():
-> 2257 self.figure.draw(renderer)
2258 else:
2259 renderer = None
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:94, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
92 @wraps(draw)
93 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 94 result = draw(artist, renderer, *args, **kwargs)
95 if renderer._rasterizing:
96 renderer.stop_rasterizing()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:71, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
68 if artist.get_agg_filter() is not None:
69 renderer.start_filter()
---> 71 return draw(artist, renderer)
72 finally:
73 if artist.get_agg_filter() is not None:
File /usr/local/lib/python3.14/site-packages/matplotlib/figure.py:3276, in Figure.draw(self, renderer)
3274 if self.axes and self.get_layout_engine() is not None:
3275 try:
-> 3276 self.get_layout_engine().execute(self)
3277 except ValueError:
3278 pass
File /usr/local/lib/python3.14/site-packages/matplotlib/layout_engine.py:278, in ConstrainedLayoutEngine.execute(self, fig)
275 w_pad = self._params['w_pad'] / width
276 h_pad = self._params['h_pad'] / height
--> 278 return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
279 wspace=self._params['wspace'],
280 hspace=self._params['hspace'],
281 rect=self._params['rect'],
282 compress=self._compress)
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:116, in do_constrained_layout(fig, h_pad, w_pad, hspace, wspace, rect, compress)
106 return
108 for _ in range(2):
109 # do the algorithm twice. This has to be done because decorations
110 # change size after the first re-position (i.e. x/yticklabels get
(...) 114 # make margins for all the Axes and subfigures in the
115 # figure. Add margins for colorbars...
--> 116 make_layout_margins(layoutgrids, fig, renderer, h_pad=h_pad,
117 w_pad=w_pad, hspace=hspace, wspace=wspace)
118 make_margin_suptitles(layoutgrids, fig, renderer, h_pad=h_pad,
119 w_pad=w_pad)
121 # if a layout is such that a columns (or rows) margin has no
122 # constraints, we need to make all such instances in the grid
123 # match in margin size.
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:389, in make_layout_margins(layoutgrids, fig, renderer, w_pad, h_pad, hspace, wspace)
385 return
387 margin = get_margin_from_padding(ax, w_pad=w_pad, h_pad=h_pad,
388 hspace=hspace, wspace=wspace)
--> 389 pos, bbox = get_pos_and_bbox(ax, renderer)
390 # the margin is the distance between the bounding box of the Axes
391 # and its position (plus the padding from above)
392 margin['left'] += pos.x0 - bbox.x0
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:637, in get_pos_and_bbox(ax, renderer)
635 # pos is in panel co-ords, but we need in figure for the layout
636 pos = pos.transformed(fig.transSubfigure - fig.transFigure)
--> 637 tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer)
638 if tightbbox is None:
639 bbox = pos
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axes/_base.py:4758, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4756 if self.axison and axis.get_visible():
4757 if for_layout_only:
-> 4758 ba = martist._get_tightbbox_for_layout_only(axis, renderer)
4759 else:
4760 ba = axis.get_tightbbox(renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1427, in Axis.get_tightbbox(self, renderer, for_layout_only)
1424 renderer = self.get_figure(root=True)._get_renderer()
1425 ticks_to_draw = self._update_ticks()
-> 1427 self._update_label_position(renderer)
1429 # go back to just this axis's tick labels
1430 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2615, in XAxis._update_label_position(self, renderer)
2611 return
2613 # get bounding boxes for this axis and any siblings
2614 # that have been set by `fig.align_xlabels()`
-> 2615 bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
2616 x, y = self.label.get_position()
2618 if self.label_position == 'bottom':
2619 # Union with extents of the bottom spine if present, of the axes otherwise.
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2403, in Axis._get_tick_boxes_siblings(self, renderer)
2401 axis = ax._axis_map[name]
2402 ticks_to_draw = axis._update_ticks()
-> 2403 tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
2404 bboxes.extend(tlb)
2405 bboxes2.extend(tlb2)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1404, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
1402 def _get_ticklabel_bboxes(self, ticks, renderer):
1403 """Return lists of bboxes for ticks' label1's and label2's."""
-> 1404 return ([tick.label1.get_window_extent(renderer)
1405 for tick in ticks
1406 if tick.label1.get_visible() and tick.label1.get_in_layout()],
1407 [tick.label2.get_window_extent(renderer)
1408 for tick in ticks
1409 if tick.label2.get_visible() and tick.label2.get_in_layout()])
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:1076, in Text.get_window_extent(self, renderer, dpi)
1071 raise RuntimeError(
1072 "Cannot get window extent of text w/o renderer. You likely "
1073 "want to call 'figure.draw_without_rendering()' first.")
1075 with cbook._setattr_cm(fig, dpi=dpi):
-> 1076 bbox, _, _ = self._get_layout(self._renderer)
1077 x, y = self.get_unitless_position()
1078 x, y = self.get_transform().transform((x, y))
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:465, in Text._get_layout(self, renderer)
462 break
463 if None in (min_ascent, min_descent):
464 # Fallback to font measurement.
--> 465 _, h, min_descent = _get_text_metrics_with_cache(
466 renderer, "lp", self._fontproperties,
467 ismath="TeX" if self.get_usetex() else False,
468 dpi=dpi)
469 min_ascent = h - min_descent
470 line_gap = 0
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:59, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
52 get_text_metrics = _get_text_metrics_function(renderer)
53 # call the function to compute the metrics and return
54 #
55 # We pass a copy of the fontprop because FontProperties is both mutable and
56 # has a `__hash__` that depends on that mutable state. This is not ideal
57 # as it means the hash of an object is not stable over time which leads to
58 # very confusing behavior when used as keys in dictionaries or hashes.
---> 59 return get_text_metrics(text, fontprop.copy(), ismath, dpi)
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:125, in _get_text_metrics_function.<locals>._text_metrics(text, fontprop, ismath, dpi)
120 raise RuntimeError(
121 "Trying to get text metrics for a renderer that no longer exists. "
122 "This should never happen and is evidence of a bug elsewhere."
123 )
124 # do the actual method call we need and return the result
--> 125 return local_renderer.get_text_width_height_descent(text, fontprop, ismath)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:256, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
254 _api.check_in_list(["TeX", True, False], ismath=ismath)
255 if ismath == "TeX":
--> 256 return super().get_text_width_height_descent(s, prop, ismath)
258 if ismath:
259 parse = self.mathtext_parser.parse(s, self.dpi, prop)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:589, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
585 fontsize = prop.get_size_in_points()
587 if ismath == 'TeX':
588 # todo: handle properties
--> 589 return self.get_texmanager().get_text_width_height_descent(
590 s, fontsize, renderer=self)
592 dpi = self.points_to_pixels(72)
593 if ismath:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:369, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
367 if tex.strip() == '':
368 return 0, 0, 0
--> 369 dvipath = cls.make_dvi(tex, fontsize)
370 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
371 with dviread.Dvi(dvipath, 72 * dpi_fraction) as dvi:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:301, in TexManager.make_dvi(cls, tex, fontsize)
298 with TemporaryDirectory(dir=dvipath.parent) as tmpdir:
299 Path(tmpdir, "file.tex").write_text(
300 cls._get_tex_source(tex, fontsize), encoding='utf-8')
--> 301 cls._run_checked_subprocess(
302 ["latex", "-interaction=nonstopmode", "-halt-on-error",
303 "-no-shell-escape", "file.tex"], tex, cwd=tmpdir)
304 Path(tmpdir, "file.dvi").replace(dvipath)
305 # Also move the tex source to the main cache directory, but
306 # only for backcompat.
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:274, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
262 raise RuntimeError(
263 '{prog} was not able to process the following string:\n'
264 '{tex!r}\n\n'
(...) 271 exc=exc.output.decode('utf-8', 'backslashreplace'))
272 ) from None
273 except (FileNotFoundError, OSError) as exc:
--> 274 raise RuntimeError(
275 f'Failed to process string with tex because {command[0]} '
276 'could not be found') from exc
277 _log.debug(report)
278 return report
RuntimeError: Failed to process string with tex because latex could not be found
<Figure size 900x1500 with 15 Axes>
pyxla.corr_ranks() corroborates pyxla.corr() since it is based on the ranks rather than the values (objective or violation).
Violation distance correlation (VDC) and rank distance correlation (RDC)¶
from pyxla import vdc, rdc
corr, plot = vdc(sphere_sample)
corr
WARNING:root:No D file is present, thus, computing the D file... Computing an entire D file can be time consuming. Instead, you can call the function with the keyword argument `compute_D_file` set to `False` to speed up computation, as only the required distances will be calculated.
INFO:root:D file has been loaded to the current sample and is saved to ./Sphere_D.csv
{'vdc_v0': np.float64(0.9999305807604988),
'vdc_v1': np.float64(0.11376465479808943)}
Error in callback <function _draw_all_if_interactive at 0x79ab71c76e50> (for post_execute), with arguments args (),kwargs {}:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
257 try:
--> 258 report = subprocess.check_output(
259 command, cwd=cwd if cwd is not None else cls._cache_dir,
260 stderr=subprocess.STDOUT)
261 except subprocess.CalledProcessError as exc:
File /usr/local/lib/python3.14/subprocess.py:473, in check_output(timeout, *popenargs, **kwargs)
471 kwargs['input'] = empty
--> 473 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
474 **kwargs).stdout
File /usr/local/lib/python3.14/subprocess.py:555, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
553 kwargs['stderr'] = PIPE
--> 555 with Popen(*popenargs, **kwargs) as process:
556 try:
File /usr/local/lib/python3.14/subprocess.py:1039, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1036 self.stderr = io.TextIOWrapper(self.stderr,
1037 encoding=encoding, errors=errors)
-> 1039 self._execute_child(args, executable, preexec_fn, close_fds,
1040 pass_fds, cwd, env,
1041 startupinfo, creationflags, shell,
1042 p2cread, p2cwrite,
1043 c2pread, c2pwrite,
1044 errread, errwrite,
1045 restore_signals,
1046 gid, gids, uid, umask,
1047 start_new_session, process_group)
1048 except:
1049 # Cleanup if the child failed starting.
File /usr/local/lib/python3.14/subprocess.py:1990, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
1989 if err_filename is not None:
-> 1990 raise child_exception_type(errno_num, err_msg, err_filename)
1991 else:
FileNotFoundError: [Errno 2] No such file or directory: 'latex'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/pyplot.py:300, in _draw_all_if_interactive()
298 def _draw_all_if_interactive() -> None:
299 if matplotlib.is_interactive():
--> 300 draw_all()
File /usr/local/lib/python3.14/site-packages/matplotlib/_pylab_helpers.py:133, in Gcf.draw_all(cls, force)
131 for manager in cls.get_all_fig_managers():
132 if force or manager.canvas.figure.stale:
--> 133 manager.canvas.draw_idle()
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:1989, in FigureCanvasBase.draw_idle(self, *args, **kwargs)
1987 if not self._is_idle_drawing:
1988 with self._idle_draw_cntx():
-> 1989 self.draw(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:438, in FigureCanvasAgg.draw(self)
435 # Acquire a lock on the shared font cache.
436 with (self.toolbar._wait_cursor_for_draw_cm() if self.toolbar
437 else nullcontext()):
--> 438 self.figure.draw(self.renderer)
439 # A GUI class may be need to update a window using this draw, so
440 # don't forget to call the superclass.
441 super().draw()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:94, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
92 @wraps(draw)
93 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 94 result = draw(artist, renderer, *args, **kwargs)
95 if renderer._rasterizing:
96 renderer.stop_rasterizing()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:71, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
68 if artist.get_agg_filter() is not None:
69 renderer.start_filter()
---> 71 return draw(artist, renderer)
72 finally:
73 if artist.get_agg_filter() is not None:
File /usr/local/lib/python3.14/site-packages/matplotlib/figure.py:3276, in Figure.draw(self, renderer)
3274 if self.axes and self.get_layout_engine() is not None:
3275 try:
-> 3276 self.get_layout_engine().execute(self)
3277 except ValueError:
3278 pass
File /usr/local/lib/python3.14/site-packages/matplotlib/layout_engine.py:278, in ConstrainedLayoutEngine.execute(self, fig)
275 w_pad = self._params['w_pad'] / width
276 h_pad = self._params['h_pad'] / height
--> 278 return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
279 wspace=self._params['wspace'],
280 hspace=self._params['hspace'],
281 rect=self._params['rect'],
282 compress=self._compress)
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:116, in do_constrained_layout(fig, h_pad, w_pad, hspace, wspace, rect, compress)
106 return
108 for _ in range(2):
109 # do the algorithm twice. This has to be done because decorations
110 # change size after the first re-position (i.e. x/yticklabels get
(...) 114 # make margins for all the Axes and subfigures in the
115 # figure. Add margins for colorbars...
--> 116 make_layout_margins(layoutgrids, fig, renderer, h_pad=h_pad,
117 w_pad=w_pad, hspace=hspace, wspace=wspace)
118 make_margin_suptitles(layoutgrids, fig, renderer, h_pad=h_pad,
119 w_pad=w_pad)
121 # if a layout is such that a columns (or rows) margin has no
122 # constraints, we need to make all such instances in the grid
123 # match in margin size.
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:389, in make_layout_margins(layoutgrids, fig, renderer, w_pad, h_pad, hspace, wspace)
385 return
387 margin = get_margin_from_padding(ax, w_pad=w_pad, h_pad=h_pad,
388 hspace=hspace, wspace=wspace)
--> 389 pos, bbox = get_pos_and_bbox(ax, renderer)
390 # the margin is the distance between the bounding box of the Axes
391 # and its position (plus the padding from above)
392 margin['left'] += pos.x0 - bbox.x0
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:637, in get_pos_and_bbox(ax, renderer)
635 # pos is in panel co-ords, but we need in figure for the layout
636 pos = pos.transformed(fig.transSubfigure - fig.transFigure)
--> 637 tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer)
638 if tightbbox is None:
639 bbox = pos
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axes/_base.py:4758, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4756 if self.axison and axis.get_visible():
4757 if for_layout_only:
-> 4758 ba = martist._get_tightbbox_for_layout_only(axis, renderer)
4759 else:
4760 ba = axis.get_tightbbox(renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1427, in Axis.get_tightbbox(self, renderer, for_layout_only)
1424 renderer = self.get_figure(root=True)._get_renderer()
1425 ticks_to_draw = self._update_ticks()
-> 1427 self._update_label_position(renderer)
1429 # go back to just this axis's tick labels
1430 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2615, in XAxis._update_label_position(self, renderer)
2611 return
2613 # get bounding boxes for this axis and any siblings
2614 # that have been set by `fig.align_xlabels()`
-> 2615 bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
2616 x, y = self.label.get_position()
2618 if self.label_position == 'bottom':
2619 # Union with extents of the bottom spine if present, of the axes otherwise.
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2403, in Axis._get_tick_boxes_siblings(self, renderer)
2401 axis = ax._axis_map[name]
2402 ticks_to_draw = axis._update_ticks()
-> 2403 tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
2404 bboxes.extend(tlb)
2405 bboxes2.extend(tlb2)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1404, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
1402 def _get_ticklabel_bboxes(self, ticks, renderer):
1403 """Return lists of bboxes for ticks' label1's and label2's."""
-> 1404 return ([tick.label1.get_window_extent(renderer)
1405 for tick in ticks
1406 if tick.label1.get_visible() and tick.label1.get_in_layout()],
1407 [tick.label2.get_window_extent(renderer)
1408 for tick in ticks
1409 if tick.label2.get_visible() and tick.label2.get_in_layout()])
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:1076, in Text.get_window_extent(self, renderer, dpi)
1071 raise RuntimeError(
1072 "Cannot get window extent of text w/o renderer. You likely "
1073 "want to call 'figure.draw_without_rendering()' first.")
1075 with cbook._setattr_cm(fig, dpi=dpi):
-> 1076 bbox, _, _ = self._get_layout(self._renderer)
1077 x, y = self.get_unitless_position()
1078 x, y = self.get_transform().transform((x, y))
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:465, in Text._get_layout(self, renderer)
462 break
463 if None in (min_ascent, min_descent):
464 # Fallback to font measurement.
--> 465 _, h, min_descent = _get_text_metrics_with_cache(
466 renderer, "lp", self._fontproperties,
467 ismath="TeX" if self.get_usetex() else False,
468 dpi=dpi)
469 min_ascent = h - min_descent
470 line_gap = 0
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:59, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
52 get_text_metrics = _get_text_metrics_function(renderer)
53 # call the function to compute the metrics and return
54 #
55 # We pass a copy of the fontprop because FontProperties is both mutable and
56 # has a `__hash__` that depends on that mutable state. This is not ideal
57 # as it means the hash of an object is not stable over time which leads to
58 # very confusing behavior when used as keys in dictionaries or hashes.
---> 59 return get_text_metrics(text, fontprop.copy(), ismath, dpi)
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:125, in _get_text_metrics_function.<locals>._text_metrics(text, fontprop, ismath, dpi)
120 raise RuntimeError(
121 "Trying to get text metrics for a renderer that no longer exists. "
122 "This should never happen and is evidence of a bug elsewhere."
123 )
124 # do the actual method call we need and return the result
--> 125 return local_renderer.get_text_width_height_descent(text, fontprop, ismath)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:256, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
254 _api.check_in_list(["TeX", True, False], ismath=ismath)
255 if ismath == "TeX":
--> 256 return super().get_text_width_height_descent(s, prop, ismath)
258 if ismath:
259 parse = self.mathtext_parser.parse(s, self.dpi, prop)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:589, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
585 fontsize = prop.get_size_in_points()
587 if ismath == 'TeX':
588 # todo: handle properties
--> 589 return self.get_texmanager().get_text_width_height_descent(
590 s, fontsize, renderer=self)
592 dpi = self.points_to_pixels(72)
593 if ismath:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:369, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
367 if tex.strip() == '':
368 return 0, 0, 0
--> 369 dvipath = cls.make_dvi(tex, fontsize)
370 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
371 with dviread.Dvi(dvipath, 72 * dpi_fraction) as dvi:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:301, in TexManager.make_dvi(cls, tex, fontsize)
298 with TemporaryDirectory(dir=dvipath.parent) as tmpdir:
299 Path(tmpdir, "file.tex").write_text(
300 cls._get_tex_source(tex, fontsize), encoding='utf-8')
--> 301 cls._run_checked_subprocess(
302 ["latex", "-interaction=nonstopmode", "-halt-on-error",
303 "-no-shell-escape", "file.tex"], tex, cwd=tmpdir)
304 Path(tmpdir, "file.dvi").replace(dvipath)
305 # Also move the tex source to the main cache directory, but
306 # only for backcompat.
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:274, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
262 raise RuntimeError(
263 '{prog} was not able to process the following string:\n'
264 '{tex!r}\n\n'
(...) 271 exc=exc.output.decode('utf-8', 'backslashreplace'))
272 ) from None
273 except (FileNotFoundError, OSError) as exc:
--> 274 raise RuntimeError(
275 f'Failed to process string with tex because {command[0]} '
276 'could not be found') from exc
277 _log.debug(report)
278 return report
RuntimeError: Failed to process string with tex because latex could not be found
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
257 try:
--> 258 report = subprocess.check_output(
259 command, cwd=cwd if cwd is not None else cls._cache_dir,
260 stderr=subprocess.STDOUT)
261 except subprocess.CalledProcessError as exc:
File /usr/local/lib/python3.14/subprocess.py:473, in check_output(timeout, *popenargs, **kwargs)
471 kwargs['input'] = empty
--> 473 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
474 **kwargs).stdout
File /usr/local/lib/python3.14/subprocess.py:555, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
553 kwargs['stderr'] = PIPE
--> 555 with Popen(*popenargs, **kwargs) as process:
556 try:
File /usr/local/lib/python3.14/subprocess.py:1039, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1036 self.stderr = io.TextIOWrapper(self.stderr,
1037 encoding=encoding, errors=errors)
-> 1039 self._execute_child(args, executable, preexec_fn, close_fds,
1040 pass_fds, cwd, env,
1041 startupinfo, creationflags, shell,
1042 p2cread, p2cwrite,
1043 c2pread, c2pwrite,
1044 errread, errwrite,
1045 restore_signals,
1046 gid, gids, uid, umask,
1047 start_new_session, process_group)
1048 except:
1049 # Cleanup if the child failed starting.
File /usr/local/lib/python3.14/subprocess.py:1990, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
1989 if err_filename is not None:
-> 1990 raise child_exception_type(errno_num, err_msg, err_filename)
1991 else:
FileNotFoundError: [Errno 2] No such file or directory: 'latex'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:2257, in FigureCanvasBase.print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)
2254 # we do this instead of `self.figure.draw_without_rendering`
2255 # so that we can inject the orientation
2256 with getattr(renderer, "_draw_disabled", nullcontext)():
-> 2257 self.figure.draw(renderer)
2258 else:
2259 renderer = None
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:94, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
92 @wraps(draw)
93 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 94 result = draw(artist, renderer, *args, **kwargs)
95 if renderer._rasterizing:
96 renderer.stop_rasterizing()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:71, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
68 if artist.get_agg_filter() is not None:
69 renderer.start_filter()
---> 71 return draw(artist, renderer)
72 finally:
73 if artist.get_agg_filter() is not None:
File /usr/local/lib/python3.14/site-packages/matplotlib/figure.py:3276, in Figure.draw(self, renderer)
3274 if self.axes and self.get_layout_engine() is not None:
3275 try:
-> 3276 self.get_layout_engine().execute(self)
3277 except ValueError:
3278 pass
File /usr/local/lib/python3.14/site-packages/matplotlib/layout_engine.py:278, in ConstrainedLayoutEngine.execute(self, fig)
275 w_pad = self._params['w_pad'] / width
276 h_pad = self._params['h_pad'] / height
--> 278 return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
279 wspace=self._params['wspace'],
280 hspace=self._params['hspace'],
281 rect=self._params['rect'],
282 compress=self._compress)
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:116, in do_constrained_layout(fig, h_pad, w_pad, hspace, wspace, rect, compress)
106 return
108 for _ in range(2):
109 # do the algorithm twice. This has to be done because decorations
110 # change size after the first re-position (i.e. x/yticklabels get
(...) 114 # make margins for all the Axes and subfigures in the
115 # figure. Add margins for colorbars...
--> 116 make_layout_margins(layoutgrids, fig, renderer, h_pad=h_pad,
117 w_pad=w_pad, hspace=hspace, wspace=wspace)
118 make_margin_suptitles(layoutgrids, fig, renderer, h_pad=h_pad,
119 w_pad=w_pad)
121 # if a layout is such that a columns (or rows) margin has no
122 # constraints, we need to make all such instances in the grid
123 # match in margin size.
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:389, in make_layout_margins(layoutgrids, fig, renderer, w_pad, h_pad, hspace, wspace)
385 return
387 margin = get_margin_from_padding(ax, w_pad=w_pad, h_pad=h_pad,
388 hspace=hspace, wspace=wspace)
--> 389 pos, bbox = get_pos_and_bbox(ax, renderer)
390 # the margin is the distance between the bounding box of the Axes
391 # and its position (plus the padding from above)
392 margin['left'] += pos.x0 - bbox.x0
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:637, in get_pos_and_bbox(ax, renderer)
635 # pos is in panel co-ords, but we need in figure for the layout
636 pos = pos.transformed(fig.transSubfigure - fig.transFigure)
--> 637 tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer)
638 if tightbbox is None:
639 bbox = pos
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axes/_base.py:4758, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4756 if self.axison and axis.get_visible():
4757 if for_layout_only:
-> 4758 ba = martist._get_tightbbox_for_layout_only(axis, renderer)
4759 else:
4760 ba = axis.get_tightbbox(renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1427, in Axis.get_tightbbox(self, renderer, for_layout_only)
1424 renderer = self.get_figure(root=True)._get_renderer()
1425 ticks_to_draw = self._update_ticks()
-> 1427 self._update_label_position(renderer)
1429 # go back to just this axis's tick labels
1430 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2615, in XAxis._update_label_position(self, renderer)
2611 return
2613 # get bounding boxes for this axis and any siblings
2614 # that have been set by `fig.align_xlabels()`
-> 2615 bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
2616 x, y = self.label.get_position()
2618 if self.label_position == 'bottom':
2619 # Union with extents of the bottom spine if present, of the axes otherwise.
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2403, in Axis._get_tick_boxes_siblings(self, renderer)
2401 axis = ax._axis_map[name]
2402 ticks_to_draw = axis._update_ticks()
-> 2403 tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
2404 bboxes.extend(tlb)
2405 bboxes2.extend(tlb2)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1404, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
1402 def _get_ticklabel_bboxes(self, ticks, renderer):
1403 """Return lists of bboxes for ticks' label1's and label2's."""
-> 1404 return ([tick.label1.get_window_extent(renderer)
1405 for tick in ticks
1406 if tick.label1.get_visible() and tick.label1.get_in_layout()],
1407 [tick.label2.get_window_extent(renderer)
1408 for tick in ticks
1409 if tick.label2.get_visible() and tick.label2.get_in_layout()])
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:1076, in Text.get_window_extent(self, renderer, dpi)
1071 raise RuntimeError(
1072 "Cannot get window extent of text w/o renderer. You likely "
1073 "want to call 'figure.draw_without_rendering()' first.")
1075 with cbook._setattr_cm(fig, dpi=dpi):
-> 1076 bbox, _, _ = self._get_layout(self._renderer)
1077 x, y = self.get_unitless_position()
1078 x, y = self.get_transform().transform((x, y))
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:465, in Text._get_layout(self, renderer)
462 break
463 if None in (min_ascent, min_descent):
464 # Fallback to font measurement.
--> 465 _, h, min_descent = _get_text_metrics_with_cache(
466 renderer, "lp", self._fontproperties,
467 ismath="TeX" if self.get_usetex() else False,
468 dpi=dpi)
469 min_ascent = h - min_descent
470 line_gap = 0
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:59, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
52 get_text_metrics = _get_text_metrics_function(renderer)
53 # call the function to compute the metrics and return
54 #
55 # We pass a copy of the fontprop because FontProperties is both mutable and
56 # has a `__hash__` that depends on that mutable state. This is not ideal
57 # as it means the hash of an object is not stable over time which leads to
58 # very confusing behavior when used as keys in dictionaries or hashes.
---> 59 return get_text_metrics(text, fontprop.copy(), ismath, dpi)
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:125, in _get_text_metrics_function.<locals>._text_metrics(text, fontprop, ismath, dpi)
120 raise RuntimeError(
121 "Trying to get text metrics for a renderer that no longer exists. "
122 "This should never happen and is evidence of a bug elsewhere."
123 )
124 # do the actual method call we need and return the result
--> 125 return local_renderer.get_text_width_height_descent(text, fontprop, ismath)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:256, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
254 _api.check_in_list(["TeX", True, False], ismath=ismath)
255 if ismath == "TeX":
--> 256 return super().get_text_width_height_descent(s, prop, ismath)
258 if ismath:
259 parse = self.mathtext_parser.parse(s, self.dpi, prop)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:589, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
585 fontsize = prop.get_size_in_points()
587 if ismath == 'TeX':
588 # todo: handle properties
--> 589 return self.get_texmanager().get_text_width_height_descent(
590 s, fontsize, renderer=self)
592 dpi = self.points_to_pixels(72)
593 if ismath:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:369, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
367 if tex.strip() == '':
368 return 0, 0, 0
--> 369 dvipath = cls.make_dvi(tex, fontsize)
370 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
371 with dviread.Dvi(dvipath, 72 * dpi_fraction) as dvi:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:301, in TexManager.make_dvi(cls, tex, fontsize)
298 with TemporaryDirectory(dir=dvipath.parent) as tmpdir:
299 Path(tmpdir, "file.tex").write_text(
300 cls._get_tex_source(tex, fontsize), encoding='utf-8')
--> 301 cls._run_checked_subprocess(
302 ["latex", "-interaction=nonstopmode", "-halt-on-error",
303 "-no-shell-escape", "file.tex"], tex, cwd=tmpdir)
304 Path(tmpdir, "file.dvi").replace(dvipath)
305 # Also move the tex source to the main cache directory, but
306 # only for backcompat.
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:274, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
262 raise RuntimeError(
263 '{prog} was not able to process the following string:\n'
264 '{tex!r}\n\n'
(...) 271 exc=exc.output.decode('utf-8', 'backslashreplace'))
272 ) from None
273 except (FileNotFoundError, OSError) as exc:
--> 274 raise RuntimeError(
275 f'Failed to process string with tex because {command[0]} '
276 'could not be found') from exc
277 _log.debug(report)
278 return report
RuntimeError: Failed to process string with tex because latex could not be found
<Figure size 600x300 with 2 Axes>
The violation values of the infeasible solutions of the Equation (2) constraint are highly correlated (0.9994) with the distance to the nearest feasible solutions. This implies that it is easy to cross to a feasible region from an infeasible region of solutions with respect to the Equation (2) constraint. Conversely, the low correlation coefficient of the Equation (3) constraint indicates a lower likelihood of crossing from an infeasible region to a feasible region.
corr, plot = rdc(sphere_sample)
corr
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[7], line 1
----> 1 corr, plot = rdc(sphere_sample)
2 corr
File /builds/aliefooghe/pyxla/src/pyxla/__init__.py:1011, in rdc(sample, compute_D_file)
1008 d_nearest_best = min(d_nearest_best, d)
1009 RDC.loc[t_idx, "distance"] = d_nearest_best
-> 1011 sp_corr, _ = scipy.stats.spearmanr(RDC[col], RDC["distance"])
1012 corrs.update({f"rdc_{col}": sp_corr})
1014 ax = axs[i] if numR > 1 else axs
File /usr/local/lib/python3.14/site-packages/scipy/stats/_stats_py.py:5446, in spearmanr(a, b, axis, nan_policy, alternative)
5442 if constant_axis:
5443 with np.errstate(invalid='ignore'):
5444 rs = np.corrcoef(a_ranked, rowvar=axisout)
5445 else:
-> 5446 rs = np.corrcoef(a_ranked, rowvar=axisout)
5447
5448 dof = n_obs - 2 # degrees of freedom
5449
File /usr/local/lib/python3.14/site-packages/numpy/lib/_function_base_impl.py:3028, in corrcoef(x, y, rowvar, dtype)
2910 @array_function_dispatch(_corrcoef_dispatcher)
2911 def corrcoef(x, y=None, rowvar=True, *,
2912 dtype=None):
2913 """
2914 Return Pearson product-moment correlation coefficients.
2915
(...) 3026
3027 """
-> 3028 c = cov(x, y, rowvar, dtype=dtype)
3029 try:
3030 d = diag(c)
File /usr/local/lib/python3.14/site-packages/numpy/lib/_function_base_impl.py:2877, in cov(m, y, rowvar, bias, ddof, fweights, aweights, dtype)
2874 else:
2875 w *= aweights
-> 2877 avg, w_sum = average(X, axis=1, weights=w, returned=True)
2878 w_sum = w_sum[0]
2880 # Determine the normalization
File /usr/local/lib/python3.14/site-packages/numpy/lib/_function_base_impl.py:607, in average(a, axis, weights, returned, keepdims)
603 avg = avg_as_array = np.multiply(a, wgt,
604 dtype=result_dtype).sum(axis, **keepdims_kw) / scl
606 if returned:
--> 607 if scl.shape != avg_as_array.shape:
608 scl = np.broadcast_to(scl, avg_as_array.shape, subok=True).copy()
609 return avg, scl
AttributeError: 'float' object has no attribute 'shape'
Error in callback <function _draw_all_if_interactive at 0x79ab71c76e50> (for post_execute), with arguments args (),kwargs {}:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
257 try:
--> 258 report = subprocess.check_output(
259 command, cwd=cwd if cwd is not None else cls._cache_dir,
260 stderr=subprocess.STDOUT)
261 except subprocess.CalledProcessError as exc:
File /usr/local/lib/python3.14/subprocess.py:473, in check_output(timeout, *popenargs, **kwargs)
471 kwargs['input'] = empty
--> 473 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
474 **kwargs).stdout
File /usr/local/lib/python3.14/subprocess.py:555, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
553 kwargs['stderr'] = PIPE
--> 555 with Popen(*popenargs, **kwargs) as process:
556 try:
File /usr/local/lib/python3.14/subprocess.py:1039, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1036 self.stderr = io.TextIOWrapper(self.stderr,
1037 encoding=encoding, errors=errors)
-> 1039 self._execute_child(args, executable, preexec_fn, close_fds,
1040 pass_fds, cwd, env,
1041 startupinfo, creationflags, shell,
1042 p2cread, p2cwrite,
1043 c2pread, c2pwrite,
1044 errread, errwrite,
1045 restore_signals,
1046 gid, gids, uid, umask,
1047 start_new_session, process_group)
1048 except:
1049 # Cleanup if the child failed starting.
File /usr/local/lib/python3.14/subprocess.py:1990, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
1989 if err_filename is not None:
-> 1990 raise child_exception_type(errno_num, err_msg, err_filename)
1991 else:
FileNotFoundError: [Errno 2] No such file or directory: 'latex'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/pyplot.py:300, in _draw_all_if_interactive()
298 def _draw_all_if_interactive() -> None:
299 if matplotlib.is_interactive():
--> 300 draw_all()
File /usr/local/lib/python3.14/site-packages/matplotlib/_pylab_helpers.py:133, in Gcf.draw_all(cls, force)
131 for manager in cls.get_all_fig_managers():
132 if force or manager.canvas.figure.stale:
--> 133 manager.canvas.draw_idle()
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:1989, in FigureCanvasBase.draw_idle(self, *args, **kwargs)
1987 if not self._is_idle_drawing:
1988 with self._idle_draw_cntx():
-> 1989 self.draw(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:438, in FigureCanvasAgg.draw(self)
435 # Acquire a lock on the shared font cache.
436 with (self.toolbar._wait_cursor_for_draw_cm() if self.toolbar
437 else nullcontext()):
--> 438 self.figure.draw(self.renderer)
439 # A GUI class may be need to update a window using this draw, so
440 # don't forget to call the superclass.
441 super().draw()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:94, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
92 @wraps(draw)
93 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 94 result = draw(artist, renderer, *args, **kwargs)
95 if renderer._rasterizing:
96 renderer.stop_rasterizing()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:71, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
68 if artist.get_agg_filter() is not None:
69 renderer.start_filter()
---> 71 return draw(artist, renderer)
72 finally:
73 if artist.get_agg_filter() is not None:
File /usr/local/lib/python3.14/site-packages/matplotlib/figure.py:3276, in Figure.draw(self, renderer)
3274 if self.axes and self.get_layout_engine() is not None:
3275 try:
-> 3276 self.get_layout_engine().execute(self)
3277 except ValueError:
3278 pass
File /usr/local/lib/python3.14/site-packages/matplotlib/layout_engine.py:278, in ConstrainedLayoutEngine.execute(self, fig)
275 w_pad = self._params['w_pad'] / width
276 h_pad = self._params['h_pad'] / height
--> 278 return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
279 wspace=self._params['wspace'],
280 hspace=self._params['hspace'],
281 rect=self._params['rect'],
282 compress=self._compress)
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:116, in do_constrained_layout(fig, h_pad, w_pad, hspace, wspace, rect, compress)
106 return
108 for _ in range(2):
109 # do the algorithm twice. This has to be done because decorations
110 # change size after the first re-position (i.e. x/yticklabels get
(...) 114 # make margins for all the Axes and subfigures in the
115 # figure. Add margins for colorbars...
--> 116 make_layout_margins(layoutgrids, fig, renderer, h_pad=h_pad,
117 w_pad=w_pad, hspace=hspace, wspace=wspace)
118 make_margin_suptitles(layoutgrids, fig, renderer, h_pad=h_pad,
119 w_pad=w_pad)
121 # if a layout is such that a columns (or rows) margin has no
122 # constraints, we need to make all such instances in the grid
123 # match in margin size.
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:389, in make_layout_margins(layoutgrids, fig, renderer, w_pad, h_pad, hspace, wspace)
385 return
387 margin = get_margin_from_padding(ax, w_pad=w_pad, h_pad=h_pad,
388 hspace=hspace, wspace=wspace)
--> 389 pos, bbox = get_pos_and_bbox(ax, renderer)
390 # the margin is the distance between the bounding box of the Axes
391 # and its position (plus the padding from above)
392 margin['left'] += pos.x0 - bbox.x0
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:637, in get_pos_and_bbox(ax, renderer)
635 # pos is in panel co-ords, but we need in figure for the layout
636 pos = pos.transformed(fig.transSubfigure - fig.transFigure)
--> 637 tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer)
638 if tightbbox is None:
639 bbox = pos
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axes/_base.py:4758, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4756 if self.axison and axis.get_visible():
4757 if for_layout_only:
-> 4758 ba = martist._get_tightbbox_for_layout_only(axis, renderer)
4759 else:
4760 ba = axis.get_tightbbox(renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1427, in Axis.get_tightbbox(self, renderer, for_layout_only)
1424 renderer = self.get_figure(root=True)._get_renderer()
1425 ticks_to_draw = self._update_ticks()
-> 1427 self._update_label_position(renderer)
1429 # go back to just this axis's tick labels
1430 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2615, in XAxis._update_label_position(self, renderer)
2611 return
2613 # get bounding boxes for this axis and any siblings
2614 # that have been set by `fig.align_xlabels()`
-> 2615 bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
2616 x, y = self.label.get_position()
2618 if self.label_position == 'bottom':
2619 # Union with extents of the bottom spine if present, of the axes otherwise.
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2403, in Axis._get_tick_boxes_siblings(self, renderer)
2401 axis = ax._axis_map[name]
2402 ticks_to_draw = axis._update_ticks()
-> 2403 tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
2404 bboxes.extend(tlb)
2405 bboxes2.extend(tlb2)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1404, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
1402 def _get_ticklabel_bboxes(self, ticks, renderer):
1403 """Return lists of bboxes for ticks' label1's and label2's."""
-> 1404 return ([tick.label1.get_window_extent(renderer)
1405 for tick in ticks
1406 if tick.label1.get_visible() and tick.label1.get_in_layout()],
1407 [tick.label2.get_window_extent(renderer)
1408 for tick in ticks
1409 if tick.label2.get_visible() and tick.label2.get_in_layout()])
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:1076, in Text.get_window_extent(self, renderer, dpi)
1071 raise RuntimeError(
1072 "Cannot get window extent of text w/o renderer. You likely "
1073 "want to call 'figure.draw_without_rendering()' first.")
1075 with cbook._setattr_cm(fig, dpi=dpi):
-> 1076 bbox, _, _ = self._get_layout(self._renderer)
1077 x, y = self.get_unitless_position()
1078 x, y = self.get_transform().transform((x, y))
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:465, in Text._get_layout(self, renderer)
462 break
463 if None in (min_ascent, min_descent):
464 # Fallback to font measurement.
--> 465 _, h, min_descent = _get_text_metrics_with_cache(
466 renderer, "lp", self._fontproperties,
467 ismath="TeX" if self.get_usetex() else False,
468 dpi=dpi)
469 min_ascent = h - min_descent
470 line_gap = 0
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:59, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
52 get_text_metrics = _get_text_metrics_function(renderer)
53 # call the function to compute the metrics and return
54 #
55 # We pass a copy of the fontprop because FontProperties is both mutable and
56 # has a `__hash__` that depends on that mutable state. This is not ideal
57 # as it means the hash of an object is not stable over time which leads to
58 # very confusing behavior when used as keys in dictionaries or hashes.
---> 59 return get_text_metrics(text, fontprop.copy(), ismath, dpi)
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:125, in _get_text_metrics_function.<locals>._text_metrics(text, fontprop, ismath, dpi)
120 raise RuntimeError(
121 "Trying to get text metrics for a renderer that no longer exists. "
122 "This should never happen and is evidence of a bug elsewhere."
123 )
124 # do the actual method call we need and return the result
--> 125 return local_renderer.get_text_width_height_descent(text, fontprop, ismath)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:256, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
254 _api.check_in_list(["TeX", True, False], ismath=ismath)
255 if ismath == "TeX":
--> 256 return super().get_text_width_height_descent(s, prop, ismath)
258 if ismath:
259 parse = self.mathtext_parser.parse(s, self.dpi, prop)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:589, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
585 fontsize = prop.get_size_in_points()
587 if ismath == 'TeX':
588 # todo: handle properties
--> 589 return self.get_texmanager().get_text_width_height_descent(
590 s, fontsize, renderer=self)
592 dpi = self.points_to_pixels(72)
593 if ismath:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:369, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
367 if tex.strip() == '':
368 return 0, 0, 0
--> 369 dvipath = cls.make_dvi(tex, fontsize)
370 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
371 with dviread.Dvi(dvipath, 72 * dpi_fraction) as dvi:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:301, in TexManager.make_dvi(cls, tex, fontsize)
298 with TemporaryDirectory(dir=dvipath.parent) as tmpdir:
299 Path(tmpdir, "file.tex").write_text(
300 cls._get_tex_source(tex, fontsize), encoding='utf-8')
--> 301 cls._run_checked_subprocess(
302 ["latex", "-interaction=nonstopmode", "-halt-on-error",
303 "-no-shell-escape", "file.tex"], tex, cwd=tmpdir)
304 Path(tmpdir, "file.dvi").replace(dvipath)
305 # Also move the tex source to the main cache directory, but
306 # only for backcompat.
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:274, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
262 raise RuntimeError(
263 '{prog} was not able to process the following string:\n'
264 '{tex!r}\n\n'
(...) 271 exc=exc.output.decode('utf-8', 'backslashreplace'))
272 ) from None
273 except (FileNotFoundError, OSError) as exc:
--> 274 raise RuntimeError(
275 f'Failed to process string with tex because {command[0]} '
276 'could not be found') from exc
277 _log.debug(report)
278 return report
RuntimeError: Failed to process string with tex because latex could not be found
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
257 try:
--> 258 report = subprocess.check_output(
259 command, cwd=cwd if cwd is not None else cls._cache_dir,
260 stderr=subprocess.STDOUT)
261 except subprocess.CalledProcessError as exc:
File /usr/local/lib/python3.14/subprocess.py:473, in check_output(timeout, *popenargs, **kwargs)
471 kwargs['input'] = empty
--> 473 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
474 **kwargs).stdout
File /usr/local/lib/python3.14/subprocess.py:555, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
553 kwargs['stderr'] = PIPE
--> 555 with Popen(*popenargs, **kwargs) as process:
556 try:
File /usr/local/lib/python3.14/subprocess.py:1039, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1036 self.stderr = io.TextIOWrapper(self.stderr,
1037 encoding=encoding, errors=errors)
-> 1039 self._execute_child(args, executable, preexec_fn, close_fds,
1040 pass_fds, cwd, env,
1041 startupinfo, creationflags, shell,
1042 p2cread, p2cwrite,
1043 c2pread, c2pwrite,
1044 errread, errwrite,
1045 restore_signals,
1046 gid, gids, uid, umask,
1047 start_new_session, process_group)
1048 except:
1049 # Cleanup if the child failed starting.
File /usr/local/lib/python3.14/subprocess.py:1990, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
1989 if err_filename is not None:
-> 1990 raise child_exception_type(errno_num, err_msg, err_filename)
1991 else:
FileNotFoundError: [Errno 2] No such file or directory: 'latex'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:2257, in FigureCanvasBase.print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)
2254 # we do this instead of `self.figure.draw_without_rendering`
2255 # so that we can inject the orientation
2256 with getattr(renderer, "_draw_disabled", nullcontext)():
-> 2257 self.figure.draw(renderer)
2258 else:
2259 renderer = None
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:94, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
92 @wraps(draw)
93 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 94 result = draw(artist, renderer, *args, **kwargs)
95 if renderer._rasterizing:
96 renderer.stop_rasterizing()
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:71, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
68 if artist.get_agg_filter() is not None:
69 renderer.start_filter()
---> 71 return draw(artist, renderer)
72 finally:
73 if artist.get_agg_filter() is not None:
File /usr/local/lib/python3.14/site-packages/matplotlib/figure.py:3276, in Figure.draw(self, renderer)
3274 if self.axes and self.get_layout_engine() is not None:
3275 try:
-> 3276 self.get_layout_engine().execute(self)
3277 except ValueError:
3278 pass
File /usr/local/lib/python3.14/site-packages/matplotlib/layout_engine.py:278, in ConstrainedLayoutEngine.execute(self, fig)
275 w_pad = self._params['w_pad'] / width
276 h_pad = self._params['h_pad'] / height
--> 278 return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
279 wspace=self._params['wspace'],
280 hspace=self._params['hspace'],
281 rect=self._params['rect'],
282 compress=self._compress)
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:116, in do_constrained_layout(fig, h_pad, w_pad, hspace, wspace, rect, compress)
106 return
108 for _ in range(2):
109 # do the algorithm twice. This has to be done because decorations
110 # change size after the first re-position (i.e. x/yticklabels get
(...) 114 # make margins for all the Axes and subfigures in the
115 # figure. Add margins for colorbars...
--> 116 make_layout_margins(layoutgrids, fig, renderer, h_pad=h_pad,
117 w_pad=w_pad, hspace=hspace, wspace=wspace)
118 make_margin_suptitles(layoutgrids, fig, renderer, h_pad=h_pad,
119 w_pad=w_pad)
121 # if a layout is such that a columns (or rows) margin has no
122 # constraints, we need to make all such instances in the grid
123 # match in margin size.
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:389, in make_layout_margins(layoutgrids, fig, renderer, w_pad, h_pad, hspace, wspace)
385 return
387 margin = get_margin_from_padding(ax, w_pad=w_pad, h_pad=h_pad,
388 hspace=hspace, wspace=wspace)
--> 389 pos, bbox = get_pos_and_bbox(ax, renderer)
390 # the margin is the distance between the bounding box of the Axes
391 # and its position (plus the padding from above)
392 margin['left'] += pos.x0 - bbox.x0
File /usr/local/lib/python3.14/site-packages/matplotlib/_constrained_layout.py:637, in get_pos_and_bbox(ax, renderer)
635 # pos is in panel co-ords, but we need in figure for the layout
636 pos = pos.transformed(fig.transSubfigure - fig.transFigure)
--> 637 tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer)
638 if tightbbox is None:
639 bbox = pos
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axes/_base.py:4758, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4756 if self.axison and axis.get_visible():
4757 if for_layout_only:
-> 4758 ba = martist._get_tightbbox_for_layout_only(axis, renderer)
4759 else:
4760 ba = axis.get_tightbbox(renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/artist.py:1485, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1479 """
1480 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1481 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1482 when encountering third-party subclasses that do not support it.
1483 """
1484 try:
-> 1485 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1486 except TypeError:
1487 return obj.get_tightbbox(*args, **kwargs)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1427, in Axis.get_tightbbox(self, renderer, for_layout_only)
1424 renderer = self.get_figure(root=True)._get_renderer()
1425 ticks_to_draw = self._update_ticks()
-> 1427 self._update_label_position(renderer)
1429 # go back to just this axis's tick labels
1430 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2615, in XAxis._update_label_position(self, renderer)
2611 return
2613 # get bounding boxes for this axis and any siblings
2614 # that have been set by `fig.align_xlabels()`
-> 2615 bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
2616 x, y = self.label.get_position()
2618 if self.label_position == 'bottom':
2619 # Union with extents of the bottom spine if present, of the axes otherwise.
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:2403, in Axis._get_tick_boxes_siblings(self, renderer)
2401 axis = ax._axis_map[name]
2402 ticks_to_draw = axis._update_ticks()
-> 2403 tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
2404 bboxes.extend(tlb)
2405 bboxes2.extend(tlb2)
File /usr/local/lib/python3.14/site-packages/matplotlib/axis.py:1404, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
1402 def _get_ticklabel_bboxes(self, ticks, renderer):
1403 """Return lists of bboxes for ticks' label1's and label2's."""
-> 1404 return ([tick.label1.get_window_extent(renderer)
1405 for tick in ticks
1406 if tick.label1.get_visible() and tick.label1.get_in_layout()],
1407 [tick.label2.get_window_extent(renderer)
1408 for tick in ticks
1409 if tick.label2.get_visible() and tick.label2.get_in_layout()])
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:1076, in Text.get_window_extent(self, renderer, dpi)
1071 raise RuntimeError(
1072 "Cannot get window extent of text w/o renderer. You likely "
1073 "want to call 'figure.draw_without_rendering()' first.")
1075 with cbook._setattr_cm(fig, dpi=dpi):
-> 1076 bbox, _, _ = self._get_layout(self._renderer)
1077 x, y = self.get_unitless_position()
1078 x, y = self.get_transform().transform((x, y))
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:465, in Text._get_layout(self, renderer)
462 break
463 if None in (min_ascent, min_descent):
464 # Fallback to font measurement.
--> 465 _, h, min_descent = _get_text_metrics_with_cache(
466 renderer, "lp", self._fontproperties,
467 ismath="TeX" if self.get_usetex() else False,
468 dpi=dpi)
469 min_ascent = h - min_descent
470 line_gap = 0
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:59, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
52 get_text_metrics = _get_text_metrics_function(renderer)
53 # call the function to compute the metrics and return
54 #
55 # We pass a copy of the fontprop because FontProperties is both mutable and
56 # has a `__hash__` that depends on that mutable state. This is not ideal
57 # as it means the hash of an object is not stable over time which leads to
58 # very confusing behavior when used as keys in dictionaries or hashes.
---> 59 return get_text_metrics(text, fontprop.copy(), ismath, dpi)
File /usr/local/lib/python3.14/site-packages/matplotlib/text.py:125, in _get_text_metrics_function.<locals>._text_metrics(text, fontprop, ismath, dpi)
120 raise RuntimeError(
121 "Trying to get text metrics for a renderer that no longer exists. "
122 "This should never happen and is evidence of a bug elsewhere."
123 )
124 # do the actual method call we need and return the result
--> 125 return local_renderer.get_text_width_height_descent(text, fontprop, ismath)
File /usr/local/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py:256, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
254 _api.check_in_list(["TeX", True, False], ismath=ismath)
255 if ismath == "TeX":
--> 256 return super().get_text_width_height_descent(s, prop, ismath)
258 if ismath:
259 parse = self.mathtext_parser.parse(s, self.dpi, prop)
File /usr/local/lib/python3.14/site-packages/matplotlib/backend_bases.py:589, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
585 fontsize = prop.get_size_in_points()
587 if ismath == 'TeX':
588 # todo: handle properties
--> 589 return self.get_texmanager().get_text_width_height_descent(
590 s, fontsize, renderer=self)
592 dpi = self.points_to_pixels(72)
593 if ismath:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:369, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
367 if tex.strip() == '':
368 return 0, 0, 0
--> 369 dvipath = cls.make_dvi(tex, fontsize)
370 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
371 with dviread.Dvi(dvipath, 72 * dpi_fraction) as dvi:
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:301, in TexManager.make_dvi(cls, tex, fontsize)
298 with TemporaryDirectory(dir=dvipath.parent) as tmpdir:
299 Path(tmpdir, "file.tex").write_text(
300 cls._get_tex_source(tex, fontsize), encoding='utf-8')
--> 301 cls._run_checked_subprocess(
302 ["latex", "-interaction=nonstopmode", "-halt-on-error",
303 "-no-shell-escape", "file.tex"], tex, cwd=tmpdir)
304 Path(tmpdir, "file.dvi").replace(dvipath)
305 # Also move the tex source to the main cache directory, but
306 # only for backcompat.
File /usr/local/lib/python3.14/site-packages/matplotlib/texmanager.py:274, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
262 raise RuntimeError(
263 '{prog} was not able to process the following string:\n'
264 '{tex!r}\n\n'
(...) 271 exc=exc.output.decode('utf-8', 'backslashreplace'))
272 ) from None
273 except (FileNotFoundError, OSError) as exc:
--> 274 raise RuntimeError(
275 f'Failed to process string with tex because {command[0]} '
276 'could not be found') from exc
277 _log.debug(report)
278 return report
RuntimeError: Failed to process string with tex because latex could not be found
<Figure size 900x600 with 6 Axes>
pyxla.rdc() corroborates pyxla.vdc() for the violation ranks.
Neighbouring solutions’ violation values correlation (NVC)¶
pyxla.nvc() indicates the level of searchability with respect to violation values.
from pyxla import nvc
corr, plot = nvc(sphere_sample)
corr
The Equation (2) constraint, being a simple sphere function, shows an almost perfect correlation. This indicates that there is high searchability with respect to the Equation (2) constraint: it is easy for a search to reach solutions of improving feasibility. Conversely, the Equation (3) constraint shows a weak negative correlation since, due to its cyclic nature, there is no strong relationship between violation values of neighbouring solutions. It is thus less likely for the search to continuously traverse along solutions of improving feasibility. Therefore, there is low searchability with respect to the Equation (3) constraint.