Question: [Bug]: gapcolor not supported for LineCollections doesn't have a or , so gapcolor doesn't work in plotting methods that return LineCollections (like vlines or hlines). ! I think the easiest fix is probably add and to LineCollection, modeled on and 1121+g509315008c

get_colors = get_color  # for compatibility with old versions     def set_gapcolor(self, gapcolor):        """        Set a color to fill the gaps in the dashed line style.        .. note::            Striped lines are created by drawing two interleaved dashed lines.            There can be overlaps between those two, which may result in            artifacts when using transparency.            This functionality is experimental and may change.        Parameters        ----------        gapcolor : color or list of colors or None            The color with which to fill the gaps. If None, the gaps are            unfilled.        """        self._original_gapcolor = gapcolor        self._set_gapcolor(gapcolor)    def _set_gapcolor(self, gapcolor):        if gapcolor is not None:            gapcolor = mcolors.to_rgba_array(gapcolor, self._alpha)        self._gapcolor = gapcolor        self.stale = True    def get_gapcolor(self):        return self._gapcolor    def _get_inverse_paths_linestyles(self):        """        Returns the path and pattern for the gaps in the non-solid lines.        This path and pattern is the inverse of the path and pattern used to        construct the non-solid lines. For solid lines, we set the inverse path        to nans to prevent drawing an inverse line.        """        path_patterns = [            (mpath.Path(np.full((1, 2), np.nan)), ls)            if ls == (0, None) else            (path, mlines._get_inverse_dash_pattern(*ls))            for (path, ls) in            zip(self._paths, itertools.cycle(self._linestyles))]        return zip(*path_patterns)  class EventCollection(LineCollection):     """diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py-- a/lib/matplotlib/lines.py++ b/lib/matplotlib/lines.py


Question: [Bug]: gapcolor not supported for LineCollections doesn't have a or , so gapcolor doesn't work in plotting methods that return LineCollections (like vlines or hlines). ! I think the easiest fix is probably add and to LineCollection, modeled on and 1121+g509315008c

return offset, dashes  <ins>def _get_inverse_dash_pattern(offset, dashes):    """Return the inverse of the given dash pattern, for filling the gaps."""    # Define the inverse pattern by moving the last gap to the start of the    # sequence.    gaps = dashes[-1:] + dashes[:-1]    # Set the offset so that this new first segment is skipped    # (see backend_bases.GraphicsContextBase.set_dashes for offset definition).    offset_gaps = offset + dashes[-1]    return offset_gaps, gaps</ins> def _scale_dashes(offset, dashes, lw):     if not mpl.rcParams['lines.scale_dashes']:         return offset, dashes


Question: [Bug]: gapcolor not supported for LineCollections doesn't have a or , so gapcolor doesn't work in plotting methods that return LineCollections (like vlines or hlines). ! I think the easiest fix is probably add and to LineCollection, modeled on and 1121+g509315008c

lc_rgba = mcolors.to_rgba(self._gapcolor, self._alpha)                     gc.set_foreground(lc_rgba, isRGBA=True)                     # Define the inverse pattern by moving the last gap to the                    # start of the sequence.                    dashes = self._dash_pattern[1]                    gaps = dashes[-1:] + dashes[:-1]                    # Set the offset so that this new first segment is skipped                    # (see backend_bases.GraphicsContextBase.set_dashes for                    # offset definition).                    offset_gaps = self._dash_pattern[0] + dashes[-1]                    offset_gaps, gaps = _get_inverse_dash_pattern(                        *self._dash_pattern)                      gc.set_dashes(offset_gaps, gaps)                     renderer.draw_path(gc, tpath, affine.frozen())


Question: [ENH]: Auto-detect bool arrays passed to contour()? I find myself fairly regularly calling to draw the boundary line between True and False regions on a boolean 2d array. Without , one gets the default 8 levels which go at 0, 0.15, 0.3, 0.45, 0.6, 0.75, 0.9, 1.05 resulting in all the contour lines being drawn on top of one another; but clearly(?), for boolean inputs, the only choice that makes sense is to have a single level at 0.5 (or rather, anywhere between 0 and 1). ! Autodetect boolean inputs to contour, and default levels to [0.5] in that case. I guess the closest similar kind of autodetection in the library is for imshow, which auto-switches between 0-1 float RGBA arrays and 0-255 uint8 RGBA arrays (when given a 3D array as input). Thoughts?

return lev[i0:i1]     def _process_contour_level_args(self, args):    def _process_contour_level_args(self, args, z_dtype):         """         Determine the contour levels and store in self.levels.         """         if self.levels is None:            if len(args) == 0:                levels_arg = 7  # Default, hard-wired.            else:            if args:                 levels_arg = args[0]            elif np.issubdtype(z_dtype, bool):                if self.filled:                    levels_arg = [0, .5, 1]                else:                    levels_arg = [.5]            else:                levels_arg = 7  # Default, hard-wired.         else:             levels_arg = self.levels         if isinstance(levels_arg, Integral):


Question: [ENH]: Auto-detect bool arrays passed to contour()? I find myself fairly regularly calling to draw the boundary line between True and False regions on a boolean 2d array. Without , one gets the default 8 levels which go at 0, 0.15, 0.3, 0.45, 0.6, 0.75, 0.9, 1.05 resulting in all the contour lines being drawn on top of one another; but clearly(?), for boolean inputs, the only choice that makes sense is to have a single level at 0.5 (or rather, anywhere between 0 and 1). ! Autodetect boolean inputs to contour, and default levels to [0.5] in that case. I guess the closest similar kind of autodetection in the library is for imshow, which auto-switches between 0-1 float RGBA arrays and 0-255 uint8 RGBA arrays (when given a 3D array as input). Thoughts?

fn = 'contour'         nargs = len(args)         if nargs <= 2:            z = ma.asarray(args[0], dtype=np.float64)            z, *args = args            z = ma.asarray(z)             x, y = self._initialize_x_y(z)            args = args[1:]         elif nargs <= 4:            x, y, z = self._check_xyz(args[:3], kwargs)            args = args[3:]            x, y, z_orig, *args = args            x, y, z = self._check_xyz(x, y, z_orig, kwargs)         else:             raise _api.nargs_error(fn, takes="from 1 to 4", given=nargs)         z = ma.masked_invalid(z, copy=False)


Question: [ENH]: Auto-detect bool arrays passed to contour()? I find myself fairly regularly calling to draw the boundary line between True and False regions on a boolean 2d array. Without , one gets the default 8 levels which go at 0, 0.15, 0.3, 0.45, 0.6, 0.75, 0.9, 1.05 resulting in all the contour lines being drawn on top of one another; but clearly(?), for boolean inputs, the only choice that makes sense is to have a single level at 0.5 (or rather, anywhere between 0 and 1). ! Autodetect boolean inputs to contour, and default levels to [0.5] in that case. I guess the closest similar kind of autodetection in the library is for imshow, which auto-switches between 0-1 float RGBA arrays and 0-255 uint8 RGBA arrays (when given a 3D array as input). Thoughts?

z = ma.masked_where(z <= 0, z)             _api.warn_external('Log scale: values of z <= 0 have been masked')             self.zmin = float(z.min())        self._process_contour_level_args(args)        self._process_contour_level_args(args, z.dtype)         return (x, y, z)     def _check_xyz(self, args, kwargs):    def _check_xyz(self, x, y, z, kwargs):         """         Check that the shapes of the input arrays match; if x and y are 1D,         convert them to 2D using meshgrid.         """        x, y = args[:2]         x, y = self.axes._process_unit_info([("x", x), ("y", y)], kwargs)          x = np.asarray(x, dtype=np.float64)         y = np.asarray(y, dtype=np.float64)        z = ma.asarray(args[2], dtype=np.float64)        z = ma.asarray(z)          if z.ndim != 2:             raise TypeError(f"Input z must be 2D, not {z.ndim}D")diff --git a/lib/matplotlib/tri/_tricontour.py b/lib/matplotlib/tri/_tricontour.py-- a/lib/matplotlib/tri/_tricontour.py++ b/lib/matplotlib/tri/_tricontour.py


Question: [ENH]: Auto-detect bool arrays passed to contour()? I find myself fairly regularly calling to draw the boundary line between True and False regions on a boolean 2d array. Without , one gets the default 8 levels which go at 0, 0.15, 0.3, 0.45, 0.6, 0.75, 0.9, 1.05 resulting in all the contour lines being drawn on top of one another; but clearly(?), for boolean inputs, the only choice that makes sense is to have a single level at 0.5 (or rather, anywhere between 0 and 1). ! Autodetect boolean inputs to contour, and default levels to [0.5] in that case. I guess the closest similar kind of autodetection in the library is for imshow, which auto-switches between 0-1 float RGBA arrays and 0-255 uint8 RGBA arrays (when given a 3D array as input). Thoughts?

def _contour_args(self, args, kwargs):         tri, args, kwargs = Triangulation.get_from_args_and_kwargs(*args,                                                                    **kwargs)        z = np.ma.asarray(args[0])        z, *args = args        z = np.ma.asarray(z)         if z.shape != tri.x.shape:             raise ValueError('z array must have same length as triangulation x'                              ' and y arrays')


Question: [ENH]: Auto-detect bool arrays passed to contour()? I find myself fairly regularly calling to draw the boundary line between True and False regions on a boolean 2d array. Without , one gets the default 8 levels which go at 0, 0.15, 0.3, 0.45, 0.6, 0.75, 0.9, 1.05 resulting in all the contour lines being drawn on top of one another; but clearly(?), for boolean inputs, the only choice that makes sense is to have a single level at 0.5 (or rather, anywhere between 0 and 1). ! Autodetect boolean inputs to contour, and default levels to [0.5] in that case. I guess the closest similar kind of autodetection in the library is for imshow, which auto-switches between 0-1 float RGBA arrays and 0-255 uint8 RGBA arrays (when given a 3D array as input). Thoughts?

if self.logscale and self.zmin <= 0:             func = 'contourf' if self.filled else 'contour'             raise ValueError(f'Cannot {func} log of negative values.')        self._process_contour_level_args(args[1:])        self._process_contour_level_args(args, z.dtype)         return (tri, z)


Question: [ENH]: Allow override of contour level autoscaling In Matplotlib 3, when using a list of values for the argument in , the list of values is overridden in the case that all requested levels fall outside the data range. While this may be desirable for casually browsing data when the user is unfamiliar with the data range, it causes serious problems for batch applications where the user legitimately intends to use their list of levels but does not know whether every input array will produce contours. Example: The above prints when is an array of values ranging from 0 to 50 (i.e., the requested contour level of 100 is outside the data range). As a result, the plot contains erroneous contours around near-zero values, presumably due to floating point precision. This is a consequence of the change described here (): Add a kwarg to that overrides the autoscaling behavior. When the kwarg is set, it would trigger a flag in ():

self.levels = self._autolev(levels_arg)         else:             self.levels = np.asarray(levels_arg, np.float64)        if not self.filled:            inside = (self.levels > self.zmin) & (self.levels < self.zmax)            levels_in = self.levels[inside]            if len(levels_in) == 0:                self.levels = [self.zmin]                _api.warn_external(                    "No contour levels were found within the data range.")         if self.filled and len(self.levels) < 2:             raise ValueError("Filled contours require at least 2 levels.")         if len(self.levels) > 1 and np.min(np.diff(self.levels)) <= 0.0:             raise ValueError("Contour levels must be increasing")


Question: [Bug]: Cannot toggle settightlayout As of calling does not disable the tight layout algorithm. AssertionError clean exit I'm pretty sure just needs to set in the falsey case. Attn: No response main No response No response No response No response

"""         if tight is None:             tight = mpl.rcParams['figure.autolayout']        _tight = 'tight' if bool(tight) else 'none'         _tight_parameters = tight if isinstance(tight, dict) else {}        if bool(tight):            self.set_layout_engine(TightLayoutEngine(**_tight_parameters))        self.set_layout_engine(_tight, **_tight_parameters)         self.stale = True      def get_constrained_layout(self):


Question: [Bug]: Cannot toggle settightlayout As of calling does not disable the tight layout algorithm. AssertionError clean exit I'm pretty sure just needs to set in the falsey case. Attn: No response main No response No response No response No response

"""         if constrained is None:             constrained = mpl.rcParams['figure.constrained_layout.use']        _constrained = bool(constrained)        _constrained = 'constrained' if bool(constrained) else 'none'         _parameters = constrained if isinstance(constrained, dict) else {}        if _constrained:            self.set_layout_engine(ConstrainedLayoutEngine(**_parameters))        self.set_layout_engine(_constrained, **_parameters)         self.stale = True      @_api.deprecated(


Question: [Bug]: NumPy 1.24 deprecation warnings Starting NumPy 1.24 I observe several deprecation warnings. No warnings. No response ArchLinux 2 QtAgg Python 3.10.9 No response Linux package manager

if not xa.dtype.isnative:             xa = xa.byteswap().newbyteorder()  # Native byteorder is faster.         if xa.dtype.kind == "f":            with np.errstate(invalid="ignore"):                xa *= self.N                # Negative values are out of range, but astype(int) would                # truncate them towards zero.                xa[xa < 0] = -1                # xa == 1 (== N after multiplication) is not out of range.                xa[xa == self.N] = self.N - 1                # Avoid converting large positive values to negative integers.                np.clip(xa, -1, self.N, out=xa)                xa = xa.astype(int)            xa *= self.N            # Negative values are out of range, but astype(int) would            # truncate them towards zero.            xa[xa < 0] = -1            # xa == 1 (== N after multiplication) is not out of range.            xa[xa == self.N] = self.N - 1            # Avoid converting large positive values to negative integers.            np.clip(xa, -1, self.N, out=xa)        with np.errstate(invalid="ignore"):            # We need this cast for unsigned ints as well as floats            xa = xa.astype(int)         # Set the over-range indices before the under-range;         # otherwise the under-range values get converted to over-range.         xa[xa > self.N - 1] = self._i_over


Question: [Bug]: compressed layout setting can be forgotten on second save I'm not sure whether this is really a bug or I'm just using an inconsistent combination of options. Under some specific circumstances (see below) compressed layout is not applied the second time a figure is saved. ! ! Both images should look like the first. If I do not set the , all is well. If I do not set in my calls to , the images are identical (but I have too much white space top and bottom). Maybe there is a better option than when using compressed layout? For context, my real example is a script that makes several figures. For most of them I want constrained layout, so I set that once in the for convenience. Only one figure needs "compressed", and I am saving twice because I want both a png and a pdf. Fixed it in my current example by just reverting the setting for the one figure. RHEL7 2 and main QtAgg 9 and 3.11 No response conda

"""     origBbox = fig.bbox     origBboxInches = fig.bbox_inches<del>    orig_layout = fig.get_layout_engine()    fig.set_layout_engine(None)</del>     _boxout = fig.transFigure._boxout      old_aspect = []


Question: [Bug]: compressed layout setting can be forgotten on second save I'm not sure whether this is really a bug or I'm just using an inconsistent combination of options. Under some specific circumstances (see below) compressed layout is not applied the second time a figure is saved. ! ! Both images should look like the first. If I do not set the , all is well. If I do not set in my calls to , the images are identical (but I have too much white space top and bottom). Maybe there is a better option than when using compressed layout? For context, my real example is a script that makes several figures. For most of them I want constrained layout, so I set that once in the for convenience. Only one figure needs "compressed", and I am saving twice because I want both a png and a pdf. Fixed it in my current example by just reverting the setting for the one figure. RHEL7 2 and main QtAgg 9 and 3.11 No response conda

fig.bbox = origBbox         fig.bbox_inches = origBboxInches<del>        fig.set_layout_engine(orig_layout)</del>         fig.transFigure._boxout = _boxout         fig.transFigure.invalidate()         fig.patch.set_bounds(0, 0, 1, 1)


Question: [Doc]: bbox parameter The documentation states that should be an instance of . When I try to use it like this I obtain the following error traceback below using matplotlib v3.6.2, whereas it works if I define it as e.g. which I guess (but just because I tried empirically) is equivalent to the method of Bbox. Either let the parameter be a proper BBox (my suggestion) or specify that the usage is that of

loc : str             The position of the cell with respect to *ax*. This must be one of             the `~.Table.codes`.        bbox : `.Bbox` or None        bbox : `.Bbox` or [xmin, ymin, width, height], optional             A bounding box to draw the table into. If this is not *None*, this             overrides *loc*.


Question: [Doc]: bbox parameter The documentation states that should be an instance of . When I try to use it like this I obtain the following error traceback below using matplotlib v3.6.2, whereas it works if I define it as e.g. which I guess (but just because I tried empirically) is equivalent to the method of Bbox. Either let the parameter be a proper BBox (my suggestion) or specify that the usage is that of

if self._bbox is not None:             # Position according to bbox            rl, rb, rw, rh = self._bbox            if isinstance(self._bbox, Bbox):                rl, rb, rw, rh = self._bbox.bounds            else:                rl, rb, rw, rh = self._bbox             self.scale(rw / w, rh / h)             ox = rl - l             oy = rb - b


Question: [Doc]: bbox parameter The documentation states that should be an instance of . When I try to use it like this I obtain the following error traceback below using matplotlib v3.6.2, whereas it works if I define it as e.g. which I guess (but just because I tried empirically) is equivalent to the method of Bbox. Either let the parameter be a proper BBox (my suggestion) or specify that the usage is that of

The position of the cell with respect to *ax*. This must be one of         the `~.Table.codes`.     bbox : `.Bbox`, optional    bbox : `.Bbox` or [xmin, ymin, width, height], optional         A bounding box to draw the table into. If this is not *None*, this         overrides *loc*.


Question: [Bug]: Setting norm with existing colorbar fails with 3.6.3 Setting the norm to a after the colorbar has been created (e.g. in interactive code) fails with an value in matplotlib 3.6.3. The same code worked in previous matplotlib versions. Not that vmin and vmax are explicitly set to values valid for and no negative values (or values == 0) exist in the input data. Works, colorbar and mappable are updated with new norm. No response Linux 3 (works with 3.6.2) Multpiple backends tested, same error in all (Qt5Agg, TkAgg, agg, ...) 15 not in jupyter conda

def autoscale(self, A):         """Set *vmin*, *vmax* to min, max of *A*."""        self.vmin = self.vmax = None        self.autoscale_None(A)        with self.callbacks.blocked():            # Pause callbacks while we are updating so we only get            # a single update signal at the end            self.vmin = self.vmax = None            self.autoscale_None(A)        self._changed()      def autoscale_None(self, A):         """If vmin or vmax are not set, use the min/max of *A* to set them."""


Question: [Bug]: Widget blitting broken when saving as PDF When running a test doc build for 3.7.0rc1, I build the PDF, which runs everything with the PDF backend. So either the PDF backend does not correctly mark itself as not supporting blitting, or the blitting is not turned off correctly in the button widgets. Docs build without warning. No response Fedora 37 v3.7.x PDF 11.1 No response git checkout

"""         return not self.active <ins>    def _changed_canvas(self):        """        Someone has switched the canvas on us!        This happens if `savefig` needs to save to a format the previous        backend did not support (e.g. saving a figure using an Agg based        backend saved to a vector format).        Returns        -------        bool           True if the canvas has been changed.        """        return self.canvas is not self.ax.figure.canvas</ins>  class AxesWidget(Widget):     """


Question: [Bug]: Widget blitting broken when saving as PDF When running a test doc build for 3.7.0rc1, I build the PDF, which runs everything with the PDF backend. So either the PDF backend does not correctly mark itself as not supporting blitting, or the blitting is not turned off correctly in the button widgets. Docs build without warning. No response Fedora 37 v3.7.x PDF 11.1 No response git checkout

def _clear(self, event):         """Internal event handler to clear the buttons."""        if self.ignore(event):        if self.ignore(event) or self._changed_canvas():             return         self._background = self.canvas.copy_from_bbox(self.ax.bbox)         self.ax.draw_artist(self._checks)


Question: [Bug]: Widget blitting broken when saving as PDF When running a test doc build for 3.7.0rc1, I build the PDF, which runs everything with the PDF backend. So either the PDF backend does not correctly mark itself as not supporting blitting, or the blitting is not turned off correctly in the button widgets. Docs build without warning. No response Fedora 37 v3.7.x PDF 11.1 No response git checkout

def _clear(self, event):         """Internal event handler to clear the buttons."""        if self.ignore(event):        if self.ignore(event) or self._changed_canvas():             return         self._background = self.canvas.copy_from_bbox(self.ax.bbox)         self.ax.draw_artist(self._buttons)


Question: [Bug]: Widget blitting broken when saving as PDF When running a test doc build for 3.7.0rc1, I build the PDF, which runs everything with the PDF backend. So either the PDF backend does not correctly mark itself as not supporting blitting, or the blitting is not turned off correctly in the button widgets. Docs build without warning. No response Fedora 37 v3.7.x PDF 11.1 No response git checkout

def clear(self, event):         """Internal event handler to clear the cursor."""        if self.ignore(event):        if self.ignore(event) or self._changed_canvas():             return         if self.useblit:             self.background = self.canvas.copy_from_bbox(self.ax.bbox)


Question: [Bug]: Widget blitting broken when saving as PDF When running a test doc build for 3.7.0rc1, I build the PDF, which runs everything with the PDF backend. So either the PDF backend does not correctly mark itself as not supporting blitting, or the blitting is not turned off correctly in the button widgets. Docs build without warning. No response Fedora 37 v3.7.x PDF 11.1 No response git checkout

return         if self.useblit:             for canvas, info in self._canvas_infos.items():<ins>                # someone has switched the canvas on us!  This happens if                # `savefig` needs to save to a format the previous backend did                # not support (e.g. saving a figure using an Agg based backend                # saved to a vector format).                if canvas is not canvas.figure.canvas:                    continue</ins>                 info["background"] = canvas.copy_from_bbox(canvas.figure.bbox)      def onmove(self, event):


Question: [Bug]: Windows correction is not correct in Windows correction is not correct in : The is not needed, and give wrong result for window with negative value, such as . For reference, the implementation of scipy can be found here : 4372. 0 No response No response latest No response No response No response None

elif mode == 'psd':         result = np.conj(result) * result     elif mode == 'magnitude':        result = np.abs(result) / np.abs(window).sum()        result = np.abs(result) / window.sum()     elif mode == 'angle' or mode == 'phase':         # we unwrap the phase later to handle the onesided vs. twosided case         result = np.angle(result)     elif mode == 'complex':        result /= np.abs(window).sum()        result /= window.sum()      if mode == 'psd':


Question: [Bug]: Windows correction is not correct in Windows correction is not correct in : The is not needed, and give wrong result for window with negative value, such as . For reference, the implementation of scipy can be found here : 4372. 0 No response No response latest No response No response No response None

result /= Fs             # Scale the spectrum by the norm of the window to compensate for             # windowing loss; see Bendat & Piersol Sec 11.5.2.            result /= (np.abs(window)**2).sum()            result /= (window**2).sum()         else:             # In this case, preserve power in the segment, not amplitude            result /= np.abs(window).sum()**2            result /= window.sum()**2      t = np.arange(NFFT/2, len(x) - NFFT/2 + 1, NFFT - noverlap)/Fs


Question: [Bug]: (x,y) disappears after changing yscale The output of (x,y) disappears while changing yscale from 'log' (initial scale for the y axis) to 'linear'. The expected outcome is generated with matplotlib==3.5.3 fillbetween and hist are working fine. MacOSX 3 MacOSX 13 No response_ pip

dimensions as the current child.         """         if hasattr(self, "_child"):  # Absent during init.<ins>            self.invalidate()</ins>             new_dims = (child.input_dims, child.output_dims)             old_dims = (self._child.input_dims, self._child.output_dims)             if new_dims != old_dims:


Question: [MNT]: FFMpegWriter does not check if out path exists when initialized. FFMpegWriter does not ensure the outputpath exists when initialized (). This leads to a broken pipe error with no mention of a non-existent path which can be misleading to the user. When setup is called, check the output path exists and if not, throw an error to inform the user.

The DPI (or resolution) for the file.  This controls the size             in pixels of the resulting movie file.         """<ins>        # Check that path is valid        Path(outfile).parent.resolve(strict=True)</ins>         self.outfile = outfile         self.fig = fig         if dpi is None:


Question: [MNT]: FFMpegWriter does not check if out path exists when initialized. FFMpegWriter does not ensure the outputpath exists when initialized (). This leads to a broken pipe error with no mention of a non-existent path which can be misleading to the user. When setup is called, check the output path exists and if not, throw an error to inform the user.

deleted by `finish`; if not *None*, no temporary files are             deleted.         """<ins>        # Check that path is valid        Path(outfile).parent.resolve(strict=True)</ins>         self.fig = fig         self.outfile = outfile         if dpi is None:


Question: [MNT]: FFMpegWriter does not check if out path exists when initialized. FFMpegWriter does not ensure the outputpath exists when initialized (). This leads to a broken pipe error with no mention of a non-existent path which can be misleading to the user. When setup is called, check the output path exists and if not, throw an error to inform the user.

self.fname_format_str = '%s%%07d.%s'      def __del__(self):        if self._tmpdir:        if hasattr(self, '_tmpdir') and self._tmpdir:             self._tmpdir.cleanup()      @property


Question: [Bug]: Validation not performed for argument to When passing non-str values to , validation is not performed. So even for invalid inputs, errors are raised only when we call Errors should be raised when invalid arguments are passed to . Similar to what we get when we pass an invalid string value as shown: Do you know why this bug is happening? No validation is done when setting values for . We do check strings on line 473, which is why we don't face this issue there. Windows 2 'TkAgg' 7 No response pip

import itertools import logging<ins>import numbers</ins> import time  import numpy as np


Question: [Bug]: Validation not performed for argument to When passing non-str values to , validation is not performed. So even for invalid inputs, errors are raised only when we call Errors should be raised when invalid arguments are passed to . Similar to what we get when we pass an invalid string value as shown: Do you know why this bug is happening? No validation is done when setting values for . We do check strings on line 473, which is why we don't face this issue there. Windows 2 'TkAgg' 7 No response pip

if not self.isaxes and loc in [0, 'best']:                 loc = 'upper right' <ins>        type_err_message = ("loc must be string, coordinate tuple, or"                            f" an integer 0-10, not {loc!r}")</ins>         # handle outside legends:         self._outside_loc = None         if isinstance(loc, str):


Question: [Bug]: Validation not performed for argument to When passing non-str values to , validation is not performed. So even for invalid inputs, errors are raised only when we call Errors should be raised when invalid arguments are passed to . Similar to what we get when we pass an invalid string value as shown: Do you know why this bug is happening? No validation is done when setting values for . We do check strings on line 473, which is why we don't face this issue there. Windows 2 'TkAgg' 7 No response pip

loc = locs[0] + ' ' + locs[1]             # check that loc is in acceptable strings             loc = _api.check_getitem(self.codes, loc=loc)<ins>        elif np.iterable(loc):            # coerce iterable into tuple            loc = tuple(loc)            # validate the tuple represents Real coordinates            if len(loc) != 2 or not all(isinstance(e, numbers.Real) for e in loc):                raise ValueError(type_err_message)        elif isinstance(loc, int):            # validate the integer represents a string numeric value            if loc < 0 or loc > 10:                raise ValueError(type_err_message)        else:            # all other cases are invalid values of loc            raise ValueError(type_err_message)</ins>          if self.isaxes and self._outside_loc:             raise ValueError(


Question: [Bug]: offsetText is colored based on instead of tick.labelcolor In version 3.6.3, when setting ytick.labelcolor / xtick.labelcolor in styles / rcParams, it does not change the color of the exponent label as well. It will be colored based on / ! ! The following patch seems to fix it for my simple usecases: No response 3 No response No response No response None

)         self.label_position = 'bottom'         if mpl.rcParams['xtick.labelcolor'] == 'inherit':            tick_color = mpl.rcParams['xtick.color']        else:            tick_color = mpl.rcParams['xtick.labelcolor']         self.offsetText.set(             x=1, y=0,             verticalalignment='top', horizontalalignment='right',             transform=mtransforms.blended_transform_factory(                 self.axes.transAxes, mtransforms.IdentityTransform()),             fontsize=mpl.rcParams['xtick.labelsize'],            color=mpl.rcParams['xtick.color'],            color=tick_color         )         self.offset_text_position = 'bottom'


Question: [Bug]: offsetText is colored based on instead of tick.labelcolor In version 3.6.3, when setting ytick.labelcolor / xtick.labelcolor in styles / rcParams, it does not change the color of the exponent label as well. It will be colored based on / ! ! The following patch seems to fix it for my simple usecases: No response 3 No response No response No response None

mtransforms.IdentityTransform(), self.axes.transAxes),         )         self.label_position = 'left'<ins>        if mpl.rcParams['ytick.labelcolor'] == 'inherit':            tick_color = mpl.rcParams['ytick.color']        else:            tick_color = mpl.rcParams['ytick.labelcolor']</ins>         # x in axes coords, y in display coords(!).         self.offsetText.set(             x=0, y=0.5,


Question: [Bug]: offsetText is colored based on instead of tick.labelcolor In version 3.6.3, when setting ytick.labelcolor / xtick.labelcolor in styles / rcParams, it does not change the color of the exponent label as well. It will be colored based on / ! ! The following patch seems to fix it for my simple usecases: No response 3 No response No response No response None

transform=mtransforms.blended_transform_factory(                 self.axes.transAxes, mtransforms.IdentityTransform()),             fontsize=mpl.rcParams['ytick.labelsize'],            color=mpl.rcParams['ytick.color'],            color=tick_color         )         self.offset_text_position = 'left'


Question: [Bug]: Unable to pickle figure with draggable legend I am unable to pickle figure with draggable legend. Same error comes for draggable annotations. Pickling successful No response Windows 10 0 No response 10 No response pip

if not ref_artist.pickable():             ref_artist.set_picker(True)         self.got_artist = False<del>        self.canvas = self.ref_artist.figure.canvas</del>         self._use_blit = use_blit and self.canvas.supports_blit         self.cids = [             self.canvas.callbacks._connect_picklable(


Question: [Bug]: Unable to pickle figure with draggable legend I am unable to pickle figure with draggable legend. Same error comes for draggable annotations. Pickling successful No response Windows 10 0 No response 10 No response pip

'button_release_event', self.on_release),         ] <ins>    # A property, not an attribute, to maintain picklability.    canvas = property(lambda self: self.ref_artist.figure.canvas)</ins>     def on_motion(self, evt):         if self._check_still_parented() and self.got_artist:             dx = evt.x - self.mouse_x


Question: [Bug]: Unable to pickle figure with aligned labels Unable to pickle figure after calling Pickling successful No response Windows 0 No response No response No response_ None

def __init__(self, init=()):         self._mapping = {weakref.ref(x): [weakref.ref(x)] for x in init} <ins>    def __getstate__(self):        return {            **vars(self),            # Convert weak refs to strong ones.            "_mapping": {k(): [v() for v in vs] for k, vs in self._mapping.items()},        }    def __setstate__(self, state):        vars(self).update(state)        # Convert strong refs to weak ones.        self._mapping = {weakref.ref(k): [*map(weakref.ref, vs)]                         for k, vs in self._mapping.items()}</ins>     def __contains__(self, item):         return weakref.ref(item) in self._mapping


Question: plt.contour with all NaNs fails assertion in Bug summary Passing an array with all NaN values into causes the following assertion to fail in : This is actually triggered by a test-case in the xarray test suite, but I imagine it hasn't been noticed (yet) because release builds of matplotlib typically disable assertion checks. Code for reproduction Actual outcome Failed assertion (see referenced line above, tracked down with ) Expected outcome I would expect to see the empty plot (and long lists of warnings) that are currently shown if assertions are disabled: ! Matplotlib version Operating system: Linux Matplotlib version: 3.0.3 Matplotlib backend (): agg Python version: 3.6 Python, matplotlib, etc are installed from source

else:             raise _api.nargs_error(fn, takes="from 1 to 4", given=nargs)         z = ma.masked_invalid(z, copy=False)        self.zmax = float(z.max())        self.zmin = float(z.min())        self.zmax = z.max().astype(float)        self.zmin = z.min().astype(float)         if self.logscale and self.zmin <= 0:             z = ma.masked_where(z <= 0, z)             _api.warn_external('Log scale: values of z <= 0 have been masked')            self.zmin = float(z.min())            self.zmin = z.min().astype(float)         self._process_contour_level_args(args, z.dtype)         return (x, y, z)


Question: [Bug]: setval of rangeslider sets incorrect value The setval() method of a range slider doesn't set the value correctly with values close to the minimal and maximal values of the range slider. With values in the middle, everything works fine. ! The values for the rangesliders "wrong" and "wrong2" are not set correctly Expected values are: (1, 2) and (9, 10) Actual values are (1, 3.25) and (7.75, 10) The result of using setval should be the same, as when using the valinit parameter of the constructor. The problem also occurred on Manjaro with: Python version: 3.10.9 Matplotlib version: 3.6.2 Matplotlib backend: QtAgg Installation of matplotlib via Linux package manager Windows 10 2 TkAgg 11.0 No response_ pip

valmin, valmax, valfmt, dragging, valstep)          # Set a value to allow _value_in_bounds() to work.        self.val = [valmin, valmax]        self.val = (valmin, valmax)         if valinit is None:             # Place at the 25th and 75th percentiles             extent = valmax - valmin


Question: [Bug]: setval of rangeslider sets incorrect value The setval() method of a range slider doesn't set the value correctly with values close to the minimal and maximal values of the range slider. With values in the middle, everything works fine. ! The values for the rangesliders "wrong" and "wrong2" are not set correctly Expected values are: (1, 2) and (9, 10) Actual values are (1, 3.25) and (7.75, 10) The result of using setval should be the same, as when using the valinit parameter of the constructor. The problem also occurred on Manjaro with: Python version: 3.10.9 Matplotlib version: 3.6.2 Matplotlib backend: QtAgg Installation of matplotlib via Linux package manager Windows 10 2 TkAgg 11.0 No response_ pip

"""         val = np.sort(val)         _api.check_shape((2,), val=val)        vmin, vmax = val        vmin = self._min_in_bounds(vmin)        vmax = self._max_in_bounds(vmax)        # Reset value to allow _value_in_bounds() to work.        self.val = (self.valmin, self.valmax)        vmin, vmax = self._value_in_bounds(val)         self._update_selection_poly(vmin, vmax)         if self.orientation == "vertical":             self._handles[0].set_ydata([vmin])


Question: [Bug]: constrained layout with wrapped titles When titles are long and wrapped, constrained layout doesn't leave enough room for them. ! Enough space for the titles. There's no problem if the titles have an explicit new line ("\n"), so this seems to be specific to the wrapping. RHEL7 0 and main QtAgg 11.0 N/A conda

of a rotated text when necessary.         """         thisx, thisy = 0.0, 0.0        lines = self.get_text().split("\n")  # Ensures lines is not empty.        lines = self._get_wrapped_text().split("\n")  # Ensures lines is not empty.          ws = []         hs = []


Question: [Bug]: AttributeError: 'LassoSelector' object has no attribute 'props' I used the LassoSelector object to select the single point in the scatterplot. But when I try to update the line color of LassoSelector with the setprops function, I get an error like this AttributeError: 'LassoSelector' object has no attribute 'props'. This warning does not occur when the comment symbol is placed at the beginning of the line "(props)" in the "set_ props" function of the matplotlib library's code.

def set_props(self, **props):         """        Set the properties of the selector artist. See the `props` argument        in the selector docstring to know which properties are supported.        Set the properties of the selector artist.        See the *props* argument in the selector docstring to know which properties are        supported.         """         artist = self._selection_artist         props = cbook.normalize_kwargs(props, artist)         artist.set(**props)         if self.useblit:             self.update()        self._props.update(props)      def set_handle_props(self, **handle_props):         """


Question: [Bug]: AttributeError: 'LassoSelector' object has no attribute 'props' I used the LassoSelector object to select the single point in the scatterplot. But when I try to update the line color of LassoSelector with the setprops function, I get an error like this AttributeError: 'LassoSelector' object has no attribute 'props'. This warning does not occur when the comment symbol is placed at the beginning of the line "(props)" in the "set_ props" function of the matplotlib library's code.

# but we maintain it until it is removed         self._pressv = None <del>        self._props = props</del>         self.onmove_callback = onmove_callback         self.minspan = minspan


Question: [Bug]: AttributeError: 'LassoSelector' object has no attribute 'props' I used the LassoSelector object to select the single point in the scatterplot. But when I try to update the line color of LassoSelector with the setprops function, I get an error like this AttributeError: 'LassoSelector' object has no attribute 'props'. This warning does not occur when the comment symbol is placed at the beginning of the line "(props)" in the "set_ props" function of the matplotlib library's code.

# Reset canvas so that `new_axes` connects events.         self.canvas = None        self.new_axes(ax)        self.new_axes(ax, _props=props)          # Setup handles         self._handle_props = {


Question: [Bug]: AttributeError: 'LassoSelector' object has no attribute 'props' I used the LassoSelector object to select the single point in the scatterplot. But when I try to update the line color of LassoSelector with the setprops function, I get an error like this AttributeError: 'LassoSelector' object has no attribute 'props'. This warning does not occur when the comment symbol is placed at the beginning of the line "(props)" in the "set_ props" function of the matplotlib library's code.

# prev attribute is deprecated but we still need to maintain it         self._prev = (0, 0)     def new_axes(self, ax):    def new_axes(self, ax, *, _props=None):         """Set SpanSelector to operate on a new Axes."""         self.ax = ax         if self.canvas is not ax.figure.canvas:


Question: [Bug]: AttributeError: 'LassoSelector' object has no attribute 'props' I used the LassoSelector object to select the single point in the scatterplot. But when I try to update the line color of LassoSelector with the setprops function, I get an error like this AttributeError: 'LassoSelector' object has no attribute 'props'. This warning does not occur when the comment symbol is placed at the beginning of the line "(props)" in the "set_ props" function of the matplotlib library's code.

else:             trans = ax.get_yaxis_transform()             w, h = 1, 0        rect_artist = Rectangle((0, 0), w, h,                                transform=trans,                                visible=False,                                **self._props)        rect_artist = Rectangle((0, 0), w, h, transform=trans, visible=False)        if _props is not None:            rect_artist.update(_props)        elif self._selection_artist is not None:            rect_artist.update_from(self._selection_artist)          self.ax.add_patch(rect_artist)         self._selection_artist = rect_artist


Question: [Bug]: AttributeError: 'LassoSelector' object has no attribute 'props' I used the LassoSelector object to select the single point in the scatterplot. But when I try to update the line color of LassoSelector with the setprops function, I get an error like this AttributeError: 'LassoSelector' object has no attribute 'props'. This warning does not occur when the comment symbol is placed at the beginning of the line "(props)" in the "set_ props" function of the matplotlib library's code.

if props is None:             props = dict(facecolor='red', edgecolor='black',                          alpha=0.2, fill=True)        self._props = {**props, 'animated': self.useblit}        self._visible = self._props.pop('visible', self._visible)        to_draw = self._init_shape(**self._props)        props = {**props, 'animated': self.useblit}        self._visible = props.pop('visible', self._visible)        to_draw = self._init_shape(**props)         self.ax.add_patch(to_draw)          self._selection_artist = to_draw


Question: [Bug]: AttributeError: 'LassoSelector' object has no attribute 'props' I used the LassoSelector object to select the single point in the scatterplot. But when I try to update the line color of LassoSelector with the setprops function, I get an error like this AttributeError: 'LassoSelector' object has no attribute 'props'. This warning does not occur when the comment symbol is placed at the beginning of the line "(props)" in the "set_ props" function of the matplotlib library's code.

if self._interactive:             self._handle_props = {                'markeredgecolor': (self._props or {}).get(                    'edgecolor', 'black'),                'markeredgecolor': (props or {}).get('edgecolor', 'black'),                 **cbook.normalize_kwargs(handle_props, Line2D)}              self._corner_order = ['SW', 'SE', 'NE', 'NW']


Question: [Bug]: AttributeError: 'LassoSelector' object has no attribute 'props' I used the LassoSelector object to select the single point in the scatterplot. But when I try to update the line color of LassoSelector with the setprops function, I get an error like this AttributeError: 'LassoSelector' object has no attribute 'props'. This warning does not occur when the comment symbol is placed at the beginning of the line "(props)" in the "set_ props" function of the matplotlib library's code.

if props is None:             props = dict(color='k', linestyle='-', linewidth=2, alpha=0.5)        self._props = {**props, 'animated': self.useblit}        self._selection_artist = line = Line2D([], [], **self._props)        props = {**props, 'animated': self.useblit}        self._selection_artist = line = Line2D([], [], **props)         self.ax.add_line(line)          if handle_props is None:             handle_props = dict(markeredgecolor='k',                                markerfacecolor=self._props.get('color', 'k'))                                markerfacecolor=props.get('color', 'k'))         self._handle_props = handle_props         self._polygon_handles = ToolHandles(self.ax, [], [],                                             useblit=self.useblit,


Question: [Bug]: LogLocator with subs argument fragile. Logarithmic tick markers do not appear if the y-axis scales a sufficient range, with the keyword argument of set to non-trivial values. ! ! I expect to see ticks in both cases, as appears in the "Good Plot". The problem is isolated to . This returns correct values in the first case (e.g., ([1.e-01 2.e-01 5.e-01 1.e+00 2.e+00 5.e+00 1.e+01 2.e+01 5.e+01 1.e+02 2.e+02 5.e+02])([]) in the second case. Windows 2 module://backendinteragg 13 No response conda [Bug]: LogLocator with subs argument fragile. Logarithmic tick markers do not appear if the y-axis scales a sufficient range, with the keyword argument of set to non-trivial values. ! ! I expect to see ticks in both cases, as appears in the "Good Plot". The problem is isolated to . This returns correct values in the first case (e.g., ([1.e-01 2.e-01 5.e-01 1.e+00 2.e+00 5.e+00 1.e+01 2.e+01 5.e+01 1.e+02 2.e+02 5.e+02])([]) in the second case. Windows 2 module://backendinteragg 13 No response conda

# Get decades between major ticks.         stride = (max(math.ceil(numdec / (numticks - 1)), 1)                   if mpl.rcParams['_internal.classic_mode'] else                  (numdec + 1) // numticks + 1)                  numdec // numticks + 1)          # if we have decided that the stride is as big or bigger than         # the range, clip the stride back to the available range - 1


Question: [ENH]: Add as alias for in AxesImage, or make that include depth too changed to . While this indeed corresponds to , this is not consistent with the numpy API, where and . Perhaps we can consider 1) tweaking to instead, and add as an alias for ? Alternatively, could return (i.e., including whether the data is colormapped, RGB, or RGBA), and we could use that* info in ? (displaying whether the data is colormapped/RGB/RGBA seems reasonably useful) No response_

def __str__(self):         try:            size = self.get_size()            return f"{type(self).__name__}(size={size!r})"            shape = self.get_shape()            return f"{type(self).__name__}(shape={shape!r})"         except RuntimeError:             return type(self).__name__


Question: [ENH]: Add as alias for in AxesImage, or make that include depth too changed to . While this indeed corresponds to , this is not consistent with the numpy API, where and . Perhaps we can consider 1) tweaking to instead, and add as an alias for ? Alternatively, could return (i.e., including whether the data is colormapped, RGB, or RGBA), and we could use that* info in ? (displaying whether the data is colormapped/RGB/RGBA seems reasonably useful) No response_

def get_size(self):         """Return the size of the image as tuple (numrows, numcols)."""        return self.get_shape()[:2]    def get_shape(self):        """        Return the shape of the image as tuple (numrows, numcols, channels).        """         if self._A is None:             raise RuntimeError('You must first set the image array')         return self._A.shape[:2]        return self._A.shape      def set_alpha(self, alpha):         """


Question: [Bug]: savefig + jpg + metadata fails with inscrutable error message If we call with a with a extension, with the kwarg specified, the error message is inscrutable. Either metadata should be , the argument ignored, or a more informative error message. No response OS/X 1 MacOSX Python 3.11.2 No response pip

"""         return self.renderer.buffer_rgba()     def print_raw(self, filename_or_obj):    def print_raw(self, filename_or_obj, *, metadata=None):        if metadata is not None:            raise ValueError("metadata not supported for raw/rgba")         FigureCanvasAgg.draw(self)         renderer = self.get_renderer()         with cbook.open_file_cm(filename_or_obj, "wb") as fh:


Question: [Bug]: savefig + jpg + metadata fails with inscrutable error message If we call with a with a extension, with the kwarg specified, the error message is inscrutable. Either metadata should be , the argument ignored, or a more informative error message. No response OS/X 1 MacOSX Python 3.11.2 No response pip

# print_figure(), and the latter ensures that `self.figure.dpi` already     # matches the dpi kwarg (if any).     def print_jpg(self, filename_or_obj, *, pil_kwargs=None):    def print_jpg(self, filename_or_obj, *, metadata=None, pil_kwargs=None):         # savefig() has already applied savefig.facecolor; we now set it to         # white to make imsave() blend semi-transparent figures against an         # assumed white background.         with mpl.rc_context({"savefig.facecolor": "white"}):            self._print_pil(filename_or_obj, "jpeg", pil_kwargs)            self._print_pil(filename_or_obj, "jpeg", pil_kwargs, metadata)      print_jpeg = print_jpg     def print_tif(self, filename_or_obj, *, pil_kwargs=None):        self._print_pil(filename_or_obj, "tiff", pil_kwargs)    def print_tif(self, filename_or_obj, *, metadata=None, pil_kwargs=None):        self._print_pil(filename_or_obj, "tiff", pil_kwargs, metadata)      print_tiff = print_tif     def print_webp(self, filename_or_obj, *, pil_kwargs=None):        self._print_pil(filename_or_obj, "webp", pil_kwargs)    def print_webp(self, filename_or_obj, *, metadata=None, pil_kwargs=None):        self._print_pil(filename_or_obj, "webp", pil_kwargs, metadata)      print_jpg.__doc__, print_tif.__doc__, print_webp.__doc__ = map(         """diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py-- a/lib/matplotlib/figure.py++ b/lib/matplotlib/figure.py


Question: [Bug]: savefig + jpg + metadata fails with inscrutable error message If we call with a with a extension, with the kwarg specified, the error message is inscrutable. Either metadata should be , the argument ignored, or a more informative error message. No response OS/X 1 MacOSX Python 3.11.2 No response pip

`~.FigureCanvasSVG.print_svg`.             - 'eps' and 'ps' with PS backend: Only 'Creator' is supported.             Not supported for 'pgf', 'raw', and 'rgba' as those formats do not support            embedding metadata.            Does not currently support 'jpg', 'tiff', or 'webp', but may include            embedding EXIF metadata in the future.         bbox_inches : str or `.Bbox`, default: :rc:`savefig.bbox`             Bounding box in inches: only the given portion of the figure is             saved.  If 'tight', try to figure out the tight bbox of the figure.diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py-- a/lib/matplotlib/image.py++ b/lib/matplotlib/image.py


Question: [Bug]: savefig + jpg + metadata fails with inscrutable error message If we call with a with a extension, with the kwarg specified, the error message is inscrutable. Either metadata should be , the argument ignored, or a more informative error message. No response OS/X 1 MacOSX Python 3.11.2 No response pip

Metadata in the image file.  The supported keys depend on the output         format, see the documentation of the respective backends for more         information.<ins>        Currently only supported for "png", "pdf", "ps", "eps", and "svg".</ins>     pil_kwargs : dict, optional         Keyword arguments passed to `PIL.Image.Image.save`.  If the 'pnginfo'         key is present, it completely overrides *metadata*, including the


Question: [Bug]: savefig + jpg + metadata fails with inscrutable error message If we call with a with a extension, with the kwarg specified, the error message is inscrutable. Either metadata should be , the argument ignored, or a more informative error message. No response OS/X 1 MacOSX Python 3.11.2 No response pip

for k, v in metadata.items():                     if v is not None:                         pnginfo.add_text(k, v)<ins>        elif metadata is not None:            raise ValueError(f"metadata not supported for format {format!r}")</ins>         if format in ["jpg", "jpeg"]:             format = "jpeg"  # Pillow doesn't recognize "jpg".             facecolor = mpl.rcParams["savefig.facecolor"]


Question: [Bug]: using clf and in range slider onchanged callback blocks input to widgets When using clear figure, adding new widgets and then redrawing the current figure in the onchanged callback of a range slider the inputs to all the widgets in the figure are blocked. When doing the same in the button callback onclicked, everything works fine. The widgets can't receive any input from a mouse click, when redrawing in the onchanged callback of a range Slider. When using a button, there is no problem. The range slider callback onchanged behaves the same as the button callback onclicked. The problem also occurred on Manjaro with: Python version: 3.10.9 Matplotlib version: 3.6.2 Matplotlib backend: QtAgg Installation of matplotlib via Linux package manager Windows 10 2 TkAgg 11.0 No response pip

self._axobservers.process("_axes_change_event", self)         self.stale = True         self._localaxes.remove(ax)<ins>        self.canvas.release_mouse(ax)</ins>          # Break link between any shared axes         for name in ax._axis_names:


Question: [Bug]: Attribute Error combining matplotlib 3.7.1 and mplcursor on data selection If you combine mplcursor and matplotlib 3.7.1, you'll get an after clicking a few data points. Henceforth, selecting a new data point will trigger the same traceback. Otherwise, it works fine. No terminal output Using matplotlib 3.7.0 or lower works fine. Using a conda install or pip install doesn't affect the output. Windows 11 and Windwos 10 1 QtAgg 16 No response conda

ref_artist.set_picker(True)         self.got_artist = False         self._use_blit = use_blit and self.canvas.supports_blit        self.cids = [            self.canvas.callbacks._connect_picklable(                'pick_event', self.on_pick),            self.canvas.callbacks._connect_picklable(                'button_release_event', self.on_release),        callbacks = ref_artist.figure._canvas_callbacks        self._disconnectors = [            functools.partial(                callbacks.disconnect, callbacks._connect_picklable(name, func))            for name, func in [                ("pick_event", self.on_pick),                ("button_release_event", self.on_release),                ("motion_notify_event", self.on_motion),            ]         ]      # A property, not an attribute, to maintain picklability.     canvas = property(lambda self: self.ref_artist.figure.canvas)     cids = property(lambda self: [        disconnect.args[0] for disconnect in self._disconnectors[:2]])     def on_motion(self, evt):         if self._check_still_parented() and self.got_artist:             dx = evt.x - self.mouse_x


Question: [Bug]: Attribute Error combining matplotlib 3.7.1 and mplcursor on data selection If you combine mplcursor and matplotlib 3.7.1, you'll get an after clicking a few data points. Henceforth, selecting a new data point will trigger the same traceback. Otherwise, it works fine. No terminal output Using matplotlib 3.7.0 or lower works fine. Using a conda install or pip install doesn't affect the output. Windows 11 and Windwos 10 1 QtAgg 16 No response conda

self.ref_artist.draw(                     self.ref_artist.figure._get_renderer())                 self.canvas.blit()            self._c1 = self.canvas.callbacks._connect_picklable(                "motion_notify_event", self.on_motion)             self.save_offset()      def on_release(self, event):         if self._check_still_parented() and self.got_artist:             self.finalize_offset()             self.got_artist = False            self.canvas.mpl_disconnect(self._c1)             if self._use_blit:                 self.ref_artist.set_animated(False)


Question: [Bug]: Attribute Error combining matplotlib 3.7.1 and mplcursor on data selection If you combine mplcursor and matplotlib 3.7.1, you'll get an after clicking a few data points. Henceforth, selecting a new data point will trigger the same traceback. Otherwise, it works fine. No terminal output Using matplotlib 3.7.0 or lower works fine. Using a conda install or pip install doesn't affect the output. Windows 11 and Windwos 10 1 QtAgg 16 No response conda

def disconnect(self):         """Disconnect the callbacks."""        for cid in self.cids:            self.canvas.mpl_disconnect(cid)        try:            c1 = self._c1        except AttributeError:            pass        else:            self.canvas.mpl_disconnect(c1)        for disconnector in self._disconnectors:            disconnector()      def save_offset(self):         pass


Question: Confusing (broken?) colormap name handling Consider the following example in which one creates and registers a new colormap and attempt to use it with the interface. Everything OK so far. Note the difference in the names and . Now when we try to use the new colormap things start to go wrong. As seen from the error message, it's that is looked up instead of the registered colormap name, . Manually looking up works just fine: For this to work as I had expected, one has to make sure that the colormap name and the registered name are the same due to some sort of "double internal name lookup tables" in matplotlib. I found this problem to be very confusing at first since I imported a colormap from another module, registered it, and tried to use it with no luck, e.g. something like: at which point, I expected to be able to refer to my newly registered colormap by the name .

"that was already in the registry.")          self._cmaps[name] = cmap.copy()        # Someone may set the extremes of a builtin colormap and want to register it        # with a different name for future lookups. The object would still have the        # builtin name, so we should update it to the registered name        if self._cmaps[name].name != name:            self._cmaps[name].name = name      def unregister(self, name):         """diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py-- a/lib/matplotlib/colors.py++ b/lib/matplotlib/colors.py


Question: Confusing (broken?) colormap name handling Consider the following example in which one creates and registers a new colormap and attempt to use it with the interface. Everything OK so far. Note the difference in the names and . Now when we try to use the new colormap things start to go wrong. As seen from the error message, it's that is looked up instead of the registered colormap name, . Manually looking up works just fine: For this to work as I had expected, one has to make sure that the colormap name and the registered name are the same due to some sort of "double internal name lookup tables" in matplotlib. I found this problem to be very confusing at first since I imported a colormap from another module, registered it, and tried to use it with no luck, e.g. something like: at which point, I expected to be able to refer to my newly registered colormap by the name .

return cmapobject      def __eq__(self, other):        if (not isinstance(other, Colormap) or self.name != other.name or        if (not isinstance(other, Colormap) or                 self.colorbar_extend != other.colorbar_extend):             return False         # To compare lookup tables the Colormaps have to be initialized


Question: Update colorbar after changing How can I update a colorbar, after I changed the norm instance of the colorbar? has now effect and throws a -Exception. Consider this example: Output for :

if mappable is None:             mappable = cm.ScalarMappable(norm=norm, cmap=cmap) <del>        # Ensure the given mappable's norm has appropriate vmin and vmax        # set even if mappable.draw has not yet been called.        if mappable.get_array() is not None:            mappable.autoscale_None()</del>         self.mappable = mappable         cmap = mappable.cmap         norm = mappable.norm


Question: Update colorbar after changing How can I update a colorbar, after I changed the norm instance of the colorbar? has now effect and throws a -Exception. Consider this example: Output for :

b = np.hstack((b, b[-1] + 1))          # transform from 0-1 to vmin-vmax:        if self.mappable.get_array() is not None:            self.mappable.autoscale_None()         if not self.norm.scaled():            # If we still aren't scaled after autoscaling, use 0, 1 as default             self.norm.vmin = 0             self.norm.vmax = 1         self.norm.vmin, self.norm.vmax = mtransforms.nonsingular(


Question: [Bug]: Setting bboxinches to a Bbox in fig.savefig resizes colorbar Setting bboxinches in fig.savefig to a specified Bbox rather than "tight" resizes the colorbar relative to when bboxinches is not set—the resulting colorbar is a lot larger than it should be. ! ! Calling fig.savefig without bboxinches set first and then calling it again with bbox_inches set produces expected outcome. Calling () prior to savefig also works. MacOS 12.2.1 (Monterey) 1 inline (for interactive), png for plot, also a problem with pdf 10 Jupyter lab 3.2.9 conda

locator_list = []     sentinel = object()     for ax in fig.axes:        locator_list.append(ax.get_axes_locator())        locator = ax.get_axes_locator()        if locator is not None:            ax.apply_aspect(locator(ax, None))        locator_list.append(locator)         current_pos = ax.get_position(original=False).frozen()         ax.set_axes_locator(lambda a, r, _pos=current_pos: _pos)         # override the method that enforces the aspect ratio on the Axes


Question: UserWarning thrown when all values are "bad", but not when only some are <!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--<!--You can feel free to delete the sections that do not apply.--Bug summary If all values passed as colors are "bad" (), a warning is thrown from numpy about converting masked values to null. If some of the values are "bad", this does not happen. Code for reproduction This does not warn: This does: This is difficult to hide since since the warning is not thrown when the figure is being constructed, but when it is shown. Here's a full traceback to show this: <details<summaryFull traceback </summary</detailsExpected outcome I wouldn't expect the second to warn if the first doesn't. Matplotlib version <!--Please specify your platform and versions of the relevant libraries you are using:--Operating system: macOS Matplotlib version: 3.3.1 Matplotlib backend (): MacOSX and Python version: 3.8.5 Jupyter version (if applicable): Replicates in python repl, but also was happening in ipython and jupyter lab Other libraries: Installed with pip [Bug]: ax.errorbar raises for all-nan data on matplotlib 3.6.2 The function raises a error when contains only values. No crash, similar to the case where only some values are NaN. This happens because unconditionally looks for a first finite element in and . Debian 2 TkAgg 2 No response pip

x0 = cbook._safe_first_finite(x0)             except (TypeError, IndexError, KeyError):                 pass            except StopIteration:                # this means we found no finite element, fall back to first                # element unconditionally                x0 = cbook.safe_first_element(x0)              try:                 x = cbook._safe_first_finite(xconv)             except (TypeError, IndexError, KeyError):                 x = xconv            except StopIteration:                # this means we found no finite element, fall back to first                # element unconditionally                x = cbook.safe_first_element(xconv)              delist = False             if not np.iterable(dx):diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py-- a/lib/matplotlib/cbook.py++ b/lib/matplotlib/cbook.py


Question: UserWarning thrown when all values are "bad", but not when only some are <!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--<!--You can feel free to delete the sections that do not apply.--Bug summary If all values passed as colors are "bad" (), a warning is thrown from numpy about converting masked values to null. If some of the values are "bad", this does not happen. Code for reproduction This does not warn: This does: This is difficult to hide since since the warning is not thrown when the figure is being constructed, but when it is shown. Here's a full traceback to show this: <details<summaryFull traceback </summary</detailsExpected outcome I wouldn't expect the second to warn if the first doesn't. Matplotlib version <!--Please specify your platform and versions of the relevant libraries you are using:--Operating system: macOS Matplotlib version: 3.3.1 Matplotlib backend (): MacOSX and Python version: 3.8.5 Jupyter version (if applicable): Replicates in python repl, but also was happening in ipython and jupyter lab Other libraries: Installed with pip [Bug]: ax.errorbar raises for all-nan data on matplotlib 3.6.2 The function raises a error when contains only values. No crash, similar to the case where only some values are NaN. This happens because unconditionally looks for a first finite element in and . Debian 2 TkAgg 2 No response pip

def _safe_first_finite(obj, *, skip_nonfinite=True):     """    Return the first non-None (and optionally finite) element in *obj*.    Return the first finite element in *obj* if one is available and skip_nonfinite is    True. Otherwise return the first element.      This is a method for internal use.     This is a type-independent way of obtaining the first non-None element,    supporting both index access and the iterator protocol.    The first non-None element will be obtained when skip_none is True.    This is a type-independent way of obtaining the first finite element, supporting    both index access and the iterator protocol.     """     def safe_isfinite(val):         if val is None:


Question: UserWarning thrown when all values are "bad", but not when only some are <!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--<!--You can feel free to delete the sections that do not apply.--Bug summary If all values passed as colors are "bad" (), a warning is thrown from numpy about converting masked values to null. If some of the values are "bad", this does not happen. Code for reproduction This does not warn: This does: This is difficult to hide since since the warning is not thrown when the figure is being constructed, but when it is shown. Here's a full traceback to show this: <details<summaryFull traceback </summary</detailsExpected outcome I wouldn't expect the second to warn if the first doesn't. Matplotlib version <!--Please specify your platform and versions of the relevant libraries you are using:--Operating system: macOS Matplotlib version: 3.3.1 Matplotlib backend (): MacOSX and Python version: 3.8.5 Jupyter version (if applicable): Replicates in python repl, but also was happening in ipython and jupyter lab Other libraries: Installed with pip [Bug]: ax.errorbar raises for all-nan data on matplotlib 3.6.2 The function raises a error when contains only values. No crash, similar to the case where only some values are NaN. This happens because unconditionally looks for a first finite element in and . Debian 2 TkAgg 2 No response pip

raise RuntimeError("matplotlib does not "                            "support generators as input")     else:        return next(val for val in obj if safe_isfinite(val))        return next((val for val in obj if safe_isfinite(val)), safe_first_element(obj))   def sanitize_sequence(data):


Question: handling of zeros in log-scale changes irreversibly after user zoom matplotlib 2.0b1 (but also present before that) Call e.g. and type "k" and "l" to switch both axes to log scale. The points at the two ends, where one of the coordinate is zero, are cropped out. This has been the behavior for a long time and seems reasonable. Now come back to linear scale ("k", "l") and zoom in with the zoom tool to one of the ends of the segment, e.g. xlims=(-0.1, 0.4), ylims=(8.6, 9.1) or something similar. Switching again to log scale now leads to a badly scaled plot, because the axis now goes all the way to (float epsilon). Even this is not unreasonable: the user effectively set his own axes limits, rather than the autocomputed ones, and these limits are invalid in log scale. The problem comes when you go back to the original limits (either "back" or "h" ("home")): even then, log-scale is broken (both axes to to instead of cropping the extremities); in fact, it seems impossible to restore the original behavior of autocomputed axes limits.

"""         Save information required to reproduce the current view.         Called before a view is changed, such as during a pan or zoom        initiated by the user. You may return any information you deem        necessary to describe the view.        This method is called before a view is changed, such as during a pan or zoom        initiated by the user.  It returns an opaque object that describes the current        view, in a format compatible with :meth:`_set_view`.         .. note::            Intended to be overridden by new projection types, but if not, the            default implementation saves the view limits. You *must* implement            :meth:`_set_view` if you implement this method.        The default implementation saves the view limits and autoscaling state.        Subclasses may override this as needed, as long as :meth:`_set_view` is also        adjusted accordingly.         """        xmin, xmax = self.get_xlim()        ymin, ymax = self.get_ylim()        return xmin, xmax, ymin, ymax        return {            "xlim": self.get_xlim(), "autoscalex_on": self.get_autoscalex_on(),            "ylim": self.get_ylim(), "autoscaley_on": self.get_autoscaley_on(),        }      def _set_view(self, view):         """         Apply a previously saved view.         Called when restoring a view, such as with the navigation buttons.        This method is called when restoring a view (with the return value of        :meth:`_get_view` as argument), such as with the navigation buttons.         .. note::            Intended to be overridden by new projection types, but if not, the            default implementation restores the view limits. You *must*            implement :meth:`_get_view` if you implement this method.        Subclasses that override :meth:`_get_view` also need to override this method        accordingly.         """        xmin, xmax, ymin, ymax = view        self.set_xlim((xmin, xmax))        self.set_ylim((ymin, ymax))        self.set(**view)      def _prepare_view_from_bbox(self, bbox, direction='in',                                 mode=None, twinx=False, twiny=False):diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py-- a/lib/mpl_toolkits/mplot3d/axes3d.py++ b/lib/mpl_toolkits/mplot3d/axes3d.py


Question: handling of zeros in log-scale changes irreversibly after user zoom matplotlib 2.0b1 (but also present before that) Call e.g. and type "k" and "l" to switch both axes to log scale. The points at the two ends, where one of the coordinate is zero, are cropped out. This has been the behavior for a long time and seems reasonable. Now come back to linear scale ("k", "l") and zoom in with the zoom tool to one of the ends of the segment, e.g. xlims=(-0.1, 0.4), ylims=(8.6, 9.1) or something similar. Switching again to log scale now leads to a badly scaled plot, because the axis now goes all the way to (float epsilon). Even this is not unreasonable: the user effectively set his own axes limits, rather than the autocomputed ones, and these limits are invalid in log scale. The problem comes when you go back to the original limits (either "back" or "h" ("home")): even then, log-scale is broken (both axes to to instead of cropping the extremities); in fact, it seems impossible to restore the original behavior of autocomputed axes limits.

def _get_view(self):         # docstring inherited        return (self.get_xlim(), self.get_ylim(), self.get_zlim(),                self.elev, self.azim, self.roll)        return {            "xlim": self.get_xlim(), "autoscalex_on": self.get_autoscalex_on(),            "ylim": self.get_ylim(), "autoscaley_on": self.get_autoscaley_on(),            "zlim": self.get_zlim(), "autoscalez_on": self.get_autoscalez_on(),        }, (self.elev, self.azim, self.roll)      def _set_view(self, view):         # docstring inherited        xlim, ylim, zlim, elev, azim, roll = view        self.set(xlim=xlim, ylim=ylim, zlim=zlim)        props, (elev, azim, roll) = view        self.set(**props)         self.elev = elev         self.azim = azim         self.roll = roll


Question: [Bug]: legend for Poly3dCollection fails When plotting an iso surface using Poly3dCollection, Supposed to insert a legend. ! on assumes is a , having the attribute . Consequently, a tuple will be generated if the 's size is not zero. In this case with , is already a and checking for will result in an error. A quick fix would be to have to make sure that colors has . MacOS 2 MacOSX 11.2 No response pip

if not hasattr(self, '_facecolors2d'):             self.axes.M = self.axes.get_proj()             self.do_3d_projection()        return self._facecolors2d        return np.asarray(self._facecolors2d)      def get_edgecolor(self):         # docstring inherited


Question: [Bug]: legend for Poly3dCollection fails When plotting an iso surface using Poly3dCollection, Supposed to insert a legend. ! on assumes is a , having the attribute . Consequently, a tuple will be generated if the 's size is not zero. In this case with , is already a and checking for will result in an error. A quick fix would be to have to make sure that colors has . MacOS 2 MacOSX 11.2 No response pip

if not hasattr(self, '_edgecolors2d'):             self.axes.M = self.axes.get_proj()             self.do_3d_projection()        return self._edgecolors2d        return np.asarray(self._edgecolors2d)   def poly_collection_2d_to_3d(col, zs=0, zdir='z'):


Question: tight layout kwargs have no effect if rc autolayout setting is set (MPL 1.5.3) Bug summary kwargs passed to tight layout do not have an effect if rc the figure.autolayout setting is set Code for reproduction No padding is inserted in the following example if figure.autolayout is set to True in the rc Matplotlib version Tested with a conda installed Matplotlib 1.5.3 on Ubuntu Linux.

and previous_engine is not None:                 _api.warn_external('The figure layout has changed to tight')         finally:            self.set_layout_engine(None)            self.set_layout_engine('none')   def figaspect(arg):


Question: [Bug]: does not work for writer.grabframe() will make snowflake movie in the example. The example runs fine after removing . https://user- https://user- No response No response 1 No response No response No response None

Grab the image information from the figure and save as a movie frame.          All keyword arguments in *savefig_kwargs* are passed on to the        `~.Figure.savefig` call that saves the figure.        `~.Figure.savefig` call that saves the figure.  However, several        keyword arguments that are supported by `~.Figure.savefig` may not be        passed as they are controlled by the MovieWriter:        - *dpi*, *bbox_inches*:  These may not be passed because each frame of the           animation much be exactly the same size in pixels.        - *format*: This is controlled by the MovieWriter.         """      @abc.abstractmethod


Question: [Bug]: does not work for writer.grabframe() will make snowflake movie in the example. The example runs fine after removing . https://user- https://user- No response No response 1 No response No response No response None

``*args, **kw`` are any parameters that should be passed to `setup`.         """        if mpl.rcParams['savefig.bbox'] == 'tight':            _log.info("Disabling savefig.bbox = 'tight', as it may cause "                      "frame size to vary, which is inappropriate for "                      "animation.")         # This particular sequence is what contextlib.contextmanager wants         self.setup(fig, outfile, dpi, *args, **kwargs)        try:            yield self        finally:            self.finish()        with mpl.rc_context({'savefig.bbox': None}):            try:                yield self            finally:                self.finish()   class MovieWriter(AbstractMovieWriter):


Question: [Bug]: does not work for writer.grabframe() will make snowflake movie in the example. The example runs fine after removing . https://user- https://user- No response No response 1 No response No response No response None

def grab_frame(self, **savefig_kwargs):         # docstring inherited<ins>        _validate_grabframe_kwargs(savefig_kwargs)</ins>         _log.debug('MovieWriter.grab_frame: Grabbing frame.')         # Readjust the figure size in case it has been changed by the user.         # All frames must have the same size to save the movie correctly.


Question: [Bug]: does not work for writer.grabframe() will make snowflake movie in the example. The example runs fine after removing . https://user- https://user- No response No response 1 No response No response No response None

def grab_frame(self, **savefig_kwargs):         # docstring inherited         # Creates a filename for saving using basename and counter.<ins>        _validate_grabframe_kwargs(savefig_kwargs)</ins>         path = Path(self._base_temp_name() % self._frame_counter)         self._temp_paths.append(path)  # Record the filename for later use.         self._frame_counter += 1  # Ensures each created name is unique.


Question: [Bug]: does not work for writer.grabframe() will make snowflake movie in the example. The example runs fine after removing . https://user- https://user- No response No response 1 No response No response No response None

self._frames = []      def grab_frame(self, **savefig_kwargs):<ins>        _validate_grabframe_kwargs(savefig_kwargs)</ins>         buf = BytesIO()         self.fig.savefig(             buf, **{**savefig_kwargs, "format": "rgba", "dpi": self.dpi})


Question: [Bug]: does not work for writer.grabframe() will make snowflake movie in the example. The example runs fine after removing . https://user- https://user- No response No response 1 No response No response No response None

self._clear_temp = False      def grab_frame(self, **savefig_kwargs):<ins>        _validate_grabframe_kwargs(savefig_kwargs)</ins>         if self.embed_frames:             # Just stop processing if we hit the limit             if self._hit_limit:


Question: [Bug]: does not work for writer.grabframe() will make snowflake movie in the example. The example runs fine after removing . https://user- https://user- No response No response 1 No response No response No response None

# TODO: Right now, after closing the figure, saving a movie won't work         # since GUI widgets are gone. Either need to remove extra code to         # allow for this non-existent use case or find a way to make it work.<del>        if mpl.rcParams['savefig.bbox'] == 'tight':            _log.info("Disabling savefig.bbox = 'tight', as it may cause "                      "frame size to vary, which is inappropriate for "                      "animation.")</del>          facecolor = savefig_kwargs.get('facecolor',                                        mpl.rcParams['savefig.facecolor'])


Question: [Bug]: does not work for writer.grabframe() will make snowflake movie in the example. The example runs fine after removing . https://user- https://user- No response No response 1 No response No response No response None

# canvas._is_saving = True makes the draw_event animation-starting         # callback a no-op; canvas.manager = None prevents resizing the GUI         # widget (both are likewise done in savefig()).        with mpl.rc_context({'savefig.bbox': None}), \             writer.saving(self._fig, filename, dpi), \             cbook._setattr_cm(self._fig.canvas,                               _is_saving=True, manager=None):        with writer.saving(self._fig, filename, dpi), \             cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None):             for anim in all_anim:                 anim._init_draw()  # Clear the initial frame             frame_number = 0


Question: [Bug]: does not work for writer.grabframe() will make snowflake movie in the example. The example runs fine after removing . https://user- https://user- No response No response 1 No response No response No response None

a.set_animated(self._blit)      save_count = _api.deprecate_privatize_attribute("3.7")<ins>def _validate_grabframe_kwargs(savefig_kwargs):    if mpl.rcParams['savefig.bbox'] == 'tight':        raise ValueError(            f"{mpl.rcParams['savefig.bbox']=} must not be 'tight' as it "            "may cause frame size to vary, which is inappropriate for animation."        )    for k in ('dpi', 'bbox_inches', 'format'):        if k in savefig_kwargs:            raise TypeError(                f"grab_frame got an unexpected keyword argument {k!r}"            )</ins>


Question: PGF output: Contour labels extend beyond figure boundary Bug summary When using contour plots with the PGF backend, contour labels close to the axes can protrude beyond the axis boundary. This was originally posted as a . Code for reproduction (See the [ example][1].) Actual outcome ! Expected outcome The contour label at the top should be clipped, just as in the first image shown in the [ example][1]. Matplotlib version Operating system: Ubuntu 17.10 Matplotlib version: 2.2.2 Matplotlib backend: PGF ( shows , though) Python version: 3.6.3 was installed through . [1]:

s = _escape_and_apply_props(s, prop)          _writeln(self.fh, r"\begin{pgfscope}")<ins>        self._print_pgf_clip(gc)</ins>          alpha = gc.get_alpha()         if alpha != 1.0:


Question: [MNT]: numdecs parameter in takes a parameter numdecs, which is not described in its docstring. I also can't find anywhere the parameter is used in the code. numdec (no s) is used within , but is calculated when needed If numdecs really isn't used, maybe remove it. Otherwise describe it in the docstring.

""" <ins>    @_api.delete_parameter("3.8", "numdecs")</ins>     def __init__(self, base=10.0, subs=(1.0,), numdecs=4, numticks=None):         """Place ticks on the locations : subs[j] * base**i."""         if numticks is None:


Question: [MNT]: numdecs parameter in takes a parameter numdecs, which is not described in its docstring. I also can't find anywhere the parameter is used in the code. numdec (no s) is used within , but is calculated when needed If numdecs really isn't used, maybe remove it. Otherwise describe it in the docstring.

numticks = 'auto'         self._base = float(base)         self._set_subs(subs)        self.numdecs = numdecs        self._numdecs = numdecs         self.numticks = numticks     @_api.delete_parameter("3.8", "numdecs")     def set_params(self, base=None, subs=None, numdecs=None, numticks=None):         """Set parameters within this locator."""         if base is not None:


Question: [MNT]: numdecs parameter in takes a parameter numdecs, which is not described in its docstring. I also can't find anywhere the parameter is used in the code. numdec (no s) is used within , but is calculated when needed If numdecs really isn't used, maybe remove it. Otherwise describe it in the docstring.

if subs is not None:             self._set_subs(subs)         if numdecs is not None:            self.numdecs = numdecs            self._numdecs = numdecs         if numticks is not None:             self.numticks = numticks     numdecs = _api.deprecate_privatize_attribute(        "3.8", addendum="This attribute has no effect.")     def _set_subs(self, subs):         """         Set the minor ticks for the log scaling every ``base**i*subs[j]``.


Question: [Bug]: bar/barh don't trigger datetime units doesn't check the units of bottom/left parameters to see if the axis needs a different converter. Same applies for : ! This works fine: ! main

height : float or array-like             The height(s) of the bars.             Note that if *bottom* has units (e.g. datetime), *height* should be in            units that are a difference from the value of *bottom* (e.g. timedelta).         width : float or array-like, default: 0.8             The width(s) of the bars.             Note that if *x* has units (e.g. datetime), then *width* should be in            units that are a difference (e.g. timedelta) around the *x* values.         bottom : float or array-like, default: 0             The y coordinate(s) of the bottom side(s) of the bars.             Note that if *bottom* has units, then the y-axis will get a Locator and            Formatter appropriate for the units (e.g. dates, or categorical).         align : {'center', 'edge'}, default: 'center'             Alignment of the bars to the *x* coordinates:


Question: [Bug]: bar/barh don't trigger datetime units doesn't check the units of bottom/left parameters to see if the axis needs a different converter. Same applies for : ! This works fine: ! main

x = 0          if orientation == 'vertical':            # It is possible for y (bottom) to contain unit information.            # However, it is also possible for y=0 for the default and height            # to contain unit information.  This will prioritize the units of y.             self._process_unit_info(                [("x", x), ("y", height)], kwargs, convert=False)                [("x", x), ("y", y), ("y", height)], kwargs, convert=False)             if log:                 self.set_yscale('log', nonpositive='clip')         else:  # horizontal            # It is possible for x (left) to contain unit information.            # However, it is also possible for x=0 for the default and width            # to contain unit information.  This will prioritize the units of x.             self._process_unit_info(                [("x", width), ("y", y)], kwargs, convert=False)                [("x", x), ("x", width), ("y", y)], kwargs, convert=False)             if log:                 self.set_xscale('log', nonpositive='clip')


Question: [Bug]: bar/barh don't trigger datetime units doesn't check the units of bottom/left parameters to see if the axis needs a different converter. Same applies for : ! This works fine: ! main

width : float or array-like             The width(s) of the bars.             Note that if *left* has units (e.g. datetime), *width* should be in            units that are a difference from the value of *left* (e.g. timedelta).         height : float or array-like, default: 0.8             The heights of the bars.             Note that if *y* has units (e.g. datetime), then *height* should be in            units that are a difference (e.g. timedelta) around the *y* values.         left : float or array-like, default: 0             The x coordinates of the left side(s) of the bars.             Note that if *left* has units, then the x-axis will get a Locator and            Formatter appropriate for the units (e.g. dates, or categorical).         align : {'center', 'edge'}, default: 'center'             Alignment of the base to the *y* coordinates*:


Question: [Bug]: fillbetween{x} does not respect Axes transform Using an axes transform with and incorrectly sets the axes limits if the Axes coordinates are larger than the data coordinates. Note that code is slightly modified from the , but with the y-data values and threshold reduced by a factor of 10. What you get a plot where the y-limits have been expanded as if I've plotted y-data spanning between (0,1), but get a fill that covers the entire axis space. <img src="https://user-" width=50%Should look like the , but with y axis labels reduced by a factor of 10. My guess is that the y-axis limits are being set by the / values in data coordinates before the transform is applied to actually fill the regions. You will get the expected result as long as the provided Axes coordinate values are less than the extreme values of the y-data itself. For example gives a correct result. <img src="https://user-" width=50%But this issue means that you can't span the axes using this technique if your plotted data does not already span y=(0,1). Windows 10 1 module://matplotlibinline.backendinline 16 3 conda

np.column_stack([ind[where], dep2[where]])])         if ind_dir == "y":             pts = pts[:, ::-1]        self.update_datalim(pts, updatex=True, updatey=True)        up_x = up_y = True        if "transform" in kwargs:            up_x, up_y = kwargs["transform"].contains_branch_seperately(self.transData)        self.update_datalim(pts, updatex=up_x, updatey=up_y)         self.add_collection(collection, autolim=False)         self._request_autoscale_view()         return collection


Question: Add fontfamily/labelfont to tickparams <!-- Welcome! Thanks for thinking of a way to improve Matplotlib. Before creating a new feature request please search the issues for relevant feature requests. --There is no simple way of assigning a fontfamily to tick labels without needing to either override the default fontfamily or setx/yticklabels. We currently have access to color and size, kwarg to change the font would fit here nicely. <!-- For example: I'm always frustrated when [...] because [...] I would like it if [...] happened when I [...] because [...] Here is a sample image of what I am asking for [...] --Add a fontfamily/labelfont kwarg to tick_params <!-- Provide a clear and concise description of a way to accomplish what you want. For example: Add an option so that when [...] [...] will happen --<!-- Add any other context or screenshots about the feature request here. You can also include links to examples of other programs that have something similar to your request. For example: Another project [...] solved this by [...] --

Tick label font size in points or as a string (e.g., 'large').         labelcolor : color             Tick label color.        labelfontfamily : str            Tick label font.         colors : color             Tick color and label color.         zorder : floatdiff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py-- a/lib/matplotlib/axis.py++ b/lib/matplotlib/axis.py


Question: Add fontfamily/labelfont to tickparams <!-- Welcome! Thanks for thinking of a way to improve Matplotlib. Before creating a new feature request please search the issues for relevant feature requests. --There is no simple way of assigning a fontfamily to tick labels without needing to either override the default fontfamily or setx/yticklabels. We currently have access to color and size, kwarg to change the font would fit here nicely. <!-- For example: I'm always frustrated when [...] because [...] I would like it if [...] happened when I [...] because [...] Here is a sample image of what I am asking for [...] --Add a fontfamily/labelfont kwarg to tick_params <!-- Provide a clear and concise description of a way to accomplish what you want. For example: Add an option so that when [...] [...] will happen --<!-- Add any other context or screenshots about the feature request here. You can also include links to examples of other programs that have something similar to your request. For example: Another project [...] solved this by [...] --

pad=None,         labelsize=None,         labelcolor=None,<ins>        labelfontfamily=None,</ins>         zorder=None,         gridOn=None,  # defaults to axes.grid depending on axes.grid.which         tick1On=True,


Question: Add fontfamily/labelfont to tickparams <!-- Welcome! Thanks for thinking of a way to improve Matplotlib. Before creating a new feature request please search the issues for relevant feature requests. --There is no simple way of assigning a fontfamily to tick labels without needing to either override the default fontfamily or setx/yticklabels. We currently have access to color and size, kwarg to change the font would fit here nicely. <!-- For example: I'm always frustrated when [...] because [...] I would like it if [...] happened when I [...] because [...] Here is a sample image of what I am asking for [...] --Add a fontfamily/labelfont kwarg to tick_params <!-- Provide a clear and concise description of a way to accomplish what you want. For example: Add an option so that when [...] [...] will happen --<!-- Add any other context or screenshots about the feature request here. You can also include links to examples of other programs that have something similar to your request. For example: Another project [...] solved this by [...] --

self.label1 = mtext.Text(             np.nan, np.nan,             fontsize=labelsize, color=labelcolor, visible=label1On,            rotation=self._labelrotation[1])            fontfamily=labelfontfamily, rotation=self._labelrotation[1])         self.label2 = mtext.Text(             np.nan, np.nan,             fontsize=labelsize, color=labelcolor, visible=label2On,            rotation=self._labelrotation[1])            fontfamily=labelfontfamily, rotation=self._labelrotation[1])          self._apply_tickdir(tickdir)


Question: Add fontfamily/labelfont to tickparams <!-- Welcome! Thanks for thinking of a way to improve Matplotlib. Before creating a new feature request please search the issues for relevant feature requests. --There is no simple way of assigning a fontfamily to tick labels without needing to either override the default fontfamily or setx/yticklabels. We currently have access to color and size, kwarg to change the font would fit here nicely. <!-- For example: I'm always frustrated when [...] because [...] I would like it if [...] happened when I [...] because [...] Here is a sample image of what I am asking for [...] --Add a fontfamily/labelfont kwarg to tick_params <!-- Provide a clear and concise description of a way to accomplish what you want. For example: Add an option so that when [...] [...] will happen --<!-- Add any other context or screenshots about the feature request here. You can also include links to examples of other programs that have something similar to your request. For example: Another project [...] solved this by [...] --

self.label2.set(rotation=self._labelrotation[1])          label_kw = {k[5:]: v for k, v in kwargs.items()                    if k in ['labelsize', 'labelcolor']}                    if k in ['labelsize', 'labelcolor', 'labelfontfamily']}         self.label1.set(**label_kw)         self.label2.set(**label_kw)