Question: [Bug]: barlabel fails with nan errorbar values appears not to be robust to bars with missing (nan) values when also including error values. This issue is similar to , but occurs in each of three cases: Case 1. When a dependent value is missing. Case 2. When an error value is missing. Case 3. When both a dependent value and an error value are missing. The error seems to happen here, but I don't know the code well enough to pinpoint what should change to fix this: runcell('Case 3: Missing dependent and error values', 'C:/Users/jam/Documents/GitHub/ci-greedy-agents-') Traceback (most recent call last): File "C:\ProgramData\Miniconda3\lib\site-packages\spyderkernels\", line 356, in compatexec exec(code, globals, locals) File "c:\users\jam\documents\github\ci-greedy-agents-base\", line 27, in <moduleax.barlabel(bars) File "C:\ProgramData\Miniconda3\lib\site-packages\matplotlib\axes\", line 2641, in barlabel endpt = err[:, 1].max() if dat = 0 else err[:, 1].min() IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed Maybe either raise an error telling me what I should do instead, or have the code resolve whatever the source is on the backend? Ideally, I think the following should happen: Case 1. Raise an error that there is no value to apply the errorbar value to. Cases 2 & 3. Ignore the missing value and move on to the next. No response Windows 10.1 1 module://matplotlibinline.backendinline 5 Spyder 5.3.0 conda

lines._internal_update(kwargs)          if len(x) > 0:            minx = x.min()            maxx = x.max()            miny = min(ymin.min(), ymax.min())            maxy = max(ymin.max(), ymax.max())            minx = np.nanmin(x)            maxx = np.nanmax(x)            miny = min(np.nanmin(ymin), np.nanmin(ymax))            maxy = max(np.nanmax(ymin), np.nanmax(ymax))              corners = (minx, miny), (maxx, maxy)             self.update_datalim(corners)


Question: [Bug]: barlabel fails with nan errorbar values appears not to be robust to bars with missing (nan) values when also including error values. This issue is similar to , but occurs in each of three cases: Case 1. When a dependent value is missing. Case 2. When an error value is missing. Case 3. When both a dependent value and an error value are missing. The error seems to happen here, but I don't know the code well enough to pinpoint what should change to fix this: runcell('Case 3: Missing dependent and error values', 'C:/Users/jam/Documents/GitHub/ci-greedy-agents-') Traceback (most recent call last): File "C:\ProgramData\Miniconda3\lib\site-packages\spyderkernels\", line 356, in compatexec exec(code, globals, locals) File "c:\users\jam\documents\github\ci-greedy-agents-base\", line 27, in <moduleax.barlabel(bars) File "C:\ProgramData\Miniconda3\lib\site-packages\matplotlib\axes\", line 2641, in barlabel endpt = err[:, 1].max() if dat = 0 else err[:, 1].min() IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed Maybe either raise an error telling me what I should do instead, or have the code resolve whatever the source is on the backend? Ideally, I think the following should happen: Case 1. Raise an error that there is no value to apply the errorbar value to. Cases 2 & 3. Ignore the missing value and move on to the next. No response Windows 10.1 1 module://matplotlibinline.backendinline 5 Spyder 5.3.0 conda

extrema = max(x0, x1) if dat >= 0 else min(x0, x1)                 length = abs(x0 - x1)             if err is None:            if err is None or np.size(err) == 0:                 endpt = extrema             elif orientation == "vertical":                 endpt = err[:, 1].max() if dat >= 0 else err[:, 1].min()


Question: [Bug]: barlabel fails with nan errorbar values appears not to be robust to bars with missing (nan) values when also including error values. This issue is similar to , but occurs in each of three cases: Case 1. When a dependent value is missing. Case 2. When an error value is missing. Case 3. When both a dependent value and an error value are missing. The error seems to happen here, but I don't know the code well enough to pinpoint what should change to fix this: runcell('Case 3: Missing dependent and error values', 'C:/Users/jam/Documents/GitHub/ci-greedy-agents-') Traceback (most recent call last): File "C:\ProgramData\Miniconda3\lib\site-packages\spyderkernels\", line 356, in compatexec exec(code, globals, locals) File "c:\users\jam\documents\github\ci-greedy-agents-base\", line 27, in <moduleax.barlabel(bars) File "C:\ProgramData\Miniconda3\lib\site-packages\matplotlib\axes\", line 2641, in barlabel endpt = err[:, 1].max() if dat = 0 else err[:, 1].min() IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed Maybe either raise an error telling me what I should do instead, or have the code resolve whatever the source is on the backend? Ideally, I think the following should happen: Case 1. Raise an error that there is no value to apply the errorbar value to. Cases 2 & 3. Ignore the missing value and move on to the next. No response Windows 10.1 1 module://matplotlibinline.backendinline 5 Spyder 5.3.0 conda

f"'{dep_axis}err' (shape: {np.shape(err)}) must be a "                     f"scalar or a 1D or (2, n) array-like whose shape matches "                     f"'{dep_axis}' (shape: {np.shape(dep)})") from None            if np.any(err < -err):  # like err<0, but also works for timedelta.            res = np.zeros_like(err, dtype=bool)  # Default in case of nan            if np.any(np.less(err, -err, out=res, where=(err == err))):                # like err<0, but also works for timedelta and nan.                 raise ValueError(                     f"'{dep_axis}err' must not contain negative values")             # This is like


Question: [Bug]: Regression in dashes due to Previously working plotting code has broken. It fails on / but passes on the parent . No line shown, error while drawing Line shown ! Maybe we use a weird/bad/incorrect convention in our code by creating and we can certainly work around it/fix it, but it used to work at least! At a minimum it might be nice to raise a nicer error if possible... Ubuntu 22.04 QtAgg (PyQt6) 10.4 No response git checkout

if np.any(dl < 0.0):                 raise ValueError(                     "All values in the dash list must be non-negative")            if not np.any(dl > 0.0):            if dl.size and not np.any(dl > 0.0):                 raise ValueError(                     'At least one value in the dash list must be positive')         self._dashes = dash_offset, dash_list


Question: [Bug]: Regression in animation from On things are fine, on the next commit from we get an error with previously working animation code. No error No response Ubuntu 22.04 QtAgg (PyQt6) 10.4 No response git checkout

# default to zeros         self._offsets = np.zeros((1, 2))        self._has_offsets = offsets is not None         if offsets is not None:        if self._has_offsets:             offsets = np.asanyarray(offsets, float)             # Broadcast (2,) -> (1, 2) but nothing else.             if offsets.shape == (2,):


Question: [Bug]: Regression in animation from On things are fine, on the next commit from we get an error with previously working animation code. No error No response Ubuntu 22.04 QtAgg (PyQt6) 10.4 No response git checkout

offsets = offsets.filled(np.nan)             # get_path_collection_extents handles nan but not masked arrays         if len(paths) and len(offsets):        if len(paths):             if any(transform.contains_branch_seperately(transData)):                 # collections that are just in data units (like quiver)                 # can properly have the axes limits set by their shape +


Question: [Bug]: Regression in animation from On things are fine, on the next commit from we get an error with previously working animation code. No error No response Ubuntu 22.04 QtAgg (PyQt6) 10.4 No response git checkout

offset_trf.transform_non_affine(offsets),                     offset_trf.get_affine().frozen())             # this is for collections that have their paths (shapes)            # in physical, axes-relative, or figure-relative units            # (i.e. like scatter). We can't uniquely set limits based on            # those shapes, so we just set the limits based on their            # location.            offsets = (offset_trf - transData).transform(offsets)            # note A-B means A B^{-1}            offsets = np.ma.masked_invalid(offsets)            if not offsets.mask.all():                bbox = transforms.Bbox.null()                bbox.update_from_data_xy(offsets)                return bbox            if self._has_offsets:                # this is for collections that have their paths (shapes)                # in physical, axes-relative, or figure-relative units                # (i.e. like scatter). We can't uniquely set limits based on                # those shapes, so we just set the limits based on their                # location.                offsets = (offset_trf - transData).transform(offsets)                # note A-B means A B^{-1}                offsets = np.ma.masked_invalid(offsets)                if not offsets.mask.all():                    bbox = transforms.Bbox.null()                    bbox.update_from_data_xy(offsets)                    return bbox         return transforms.Bbox.null()      def get_window_extent(self, renderer):


Question: [Bug]: Can't use on axes created using subfigures Using on an axes created using subfigures result in an error. It should set the given ax as the current axe, as done by the code below: No response UBuntu 20.04 1 QtAgg 10 No response pip

from matplotlib import cbook from matplotlib import _docstring from matplotlib.backend_bases import FigureCanvasBase, MouseButtonfrom matplotlib.figure import Figure, figaspectfrom matplotlib.figure import Figure, FigureBase, figaspect from matplotlib.gridspec import GridSpec, SubplotSpec from matplotlib import rcParams, rcParamsDefault, get_backend, rcParamsOrig from matplotlib.rcsetup import interactive_bk as _interactive_bk


Question: [Bug]: Can't use on axes created using subfigures Using on an axes created using subfigures result in an error. It should set the given ax as the current axe, as done by the code below: No response UBuntu 20.04 1 QtAgg 10 No response pip

Parameters     ----------    num : int or str or `.Figure`, optional    num : int or str or `.Figure` or `.SubFigure`, optional         A unique identifier for the figure.          If a figure with that identifier already exists, this figure is made


Question: [Bug]: Can't use on axes created using subfigures Using on an axes created using subfigures result in an error. It should set the given ax as the current axe, as done by the code below: No response UBuntu 20.04 1 QtAgg 10 No response pip

will be used for the ``Figure.number`` attribute, otherwise, an         auto-generated integer value is used (starting at 1 and incremented         for each new figure). If *num* is a string, the figure label and the        window title is set to this value.        window title is set to this value.  If num is a ``SubFigure``, its        parent ``Figure`` is activated.      figsize : (float, float), default: :rc:`figure.figsize`         Width, height in inches.


Question: [Bug]: Can't use on axes created using subfigures Using on an axes created using subfigures result in an error. It should set the given ax as the current axe, as done by the code below: No response UBuntu 20.04 1 QtAgg 10 No response pip

`~matplotlib.rcParams` defines the default values, which can be modified     in the matplotlibrc file.     """    if isinstance(num, Figure):    if isinstance(num, FigureBase):         if num.canvas.manager is None:             raise ValueError("The passed figure is not managed by pyplot")         _pylab_helpers.Gcf.set_active(num.canvas.manager)        return num        return num.figure      allnums = get_fignums()     next_num = max(allnums) + 1 if allnums else 1


Question: [MNT]: Require that matplotlibrc/style files use utf-8 (or have an encoding cookie) Currently, matplotlibrc and style files are read with the locale encoding, since . There's even a test for it in , which reads But actually, we probably never really supported non-ascii encodings (such as utf-32-be), because if you try to import matplotlib in such a context, we will fail much earlier, when trying to read the default matplotlibrc file: gives (the test doesn't see that because the default matplotlibrc file has already been imported at this point...). This behavior also means that style files are actually not shareable between systems that use incompatible encodings. Given that was implemented in response to , which is about the Py2/Py3 unicode transition and not any user actually requesting support for non-standard encodings, I think we should just drop any intent of reading matplotlibrc/style files using the user locale, and instead spec them as being utf-8 (or, if we want to be super-flexible, support encoding cookies as in / -- but I'd say it's probably not worth it?). No response

yield (line.decode('utf-8') for line in f)     else:         fname = os.path.expanduser(fname)        encoding = locale.getpreferredencoding(do_setlocale=False)        if encoding is None:            encoding = "utf-8"        with open(fname, encoding=encoding) as f:        with open(fname, encoding='utf-8') as f:             yield f


Question: [MNT]: Require that matplotlibrc/style files use utf-8 (or have an encoding cookie) Currently, matplotlibrc and style files are read with the locale encoding, since . There's even a test for it in , which reads But actually, we probably never really supported non-ascii encodings (such as utf-32-be), because if you try to import matplotlib in such a context, we will fail much earlier, when trying to read the default matplotlibrc file: gives (the test doesn't see that because the default matplotlibrc file has already been imported at this point...). This behavior also means that style files are actually not shareable between systems that use incompatible encodings. Given that was implemented in response to , which is about the Py2/Py3 unicode transition and not any user actually requesting support for non-standard encodings, I think we should just drop any intent of reading matplotlibrc/style files using the user locale, and instead spec them as being utf-8 (or, if we want to be super-flexible, support encoding cookies as in / -- but I'd say it's probably not worth it?). No response

fname, line_no, line.rstrip('\n'))                 rc_temp[key] = (val, line, line_no)         except UnicodeDecodeError:            _log.warning('Cannot decode configuration file %s with encoding '                         '%s, check LANG and LC_* variables.',                         fname,                         locale.getpreferredencoding(do_setlocale=False)                         or 'utf-8 (default)')            _log.warning('Cannot decode configuration file %r as utf-8.',                         fname)             raise      config = RcParams()diff --git a/setup.py b/setup.py-- a/setup.py++ b/setup.py


Question: [MNT]: Require that matplotlibrc/style files use utf-8 (or have an encoding cookie) Currently, matplotlibrc and style files are read with the locale encoding, since . There's even a test for it in , which reads But actually, we probably never really supported non-ascii encodings (such as utf-32-be), because if you try to import matplotlib in such a context, we will fail much earlier, when trying to read the default matplotlibrc file: gives (the test doesn't see that because the default matplotlibrc file has already been imported at this point...). This behavior also means that style files are actually not shareable between systems that use incompatible encodings. Given that was implemented in response to , which is about the Py2/Py3 unicode transition and not any user actually requesting support for non-standard encodings, I think we should just drop any intent of reading matplotlibrc/style files using the user locale, and instead spec them as being utf-8 (or, if we want to be super-flexible, support encoding cookies as in / -- but I'd say it's probably not worth it?). No response

# line.  Otherwise, use the default `##backend: Agg` which has no effect     # even after decommenting, which allows _auto_backend_sentinel to be filled     # in at import time.    template_lines = path.read_text().splitlines(True)    template_lines = path.read_text(encoding="utf-8").splitlines(True)     backend_line_idx, = [  # Also asserts that there is a single such line.         idx for idx, line in enumerate(template_lines)         if "#backend:" in line]


Question: [MNT]: Require that matplotlibrc/style files use utf-8 (or have an encoding cookie) Currently, matplotlibrc and style files are read with the locale encoding, since . There's even a test for it in , which reads But actually, we probably never really supported non-ascii encodings (such as utf-32-be), because if you try to import matplotlib in such a context, we will fail much earlier, when trying to read the default matplotlibrc file: gives (the test doesn't see that because the default matplotlibrc file has already been imported at this point...). This behavior also means that style files are actually not shareable between systems that use incompatible encodings. Given that was implemented in response to , which is about the Py2/Py3 unicode transition and not any user actually requesting support for non-standard encodings, I think we should just drop any intent of reading matplotlibrc/style files using the user locale, and instead spec them as being utf-8 (or, if we want to be super-flexible, support encoding cookies as in / -- but I'd say it's probably not worth it?). No response

"#backend: {}\n".format(setupext.options["backend"])         if setupext.options["backend"]         else "##backend: Agg\n")    path.write_text("".join(template_lines))    path.write_text("".join(template_lines), encoding="utf-8")   class BuildPy(setuptools.command.build_py.build_py):


Question: [Bug]: Gaps and overlapping areas between bins when using float16 When creating a histogram out of float16 data, the bins are also calculated in float16. The lower precision can cause two errors: 1) Gaps between certain bins. 2) Two neighboring bins overlap each other (only visible when alpha < 1) ! ! Created by ((np.float32), bins=100, alpha=0.5) () Possible solution Calculate the bins in float32: Determine minimal and maximal value in float16. Convert min and max to float32. Calculate the bin edges. Theoretical possible, but unwanted solution Convert data into float32 before calculating the histogram. This behavior does not make a lot of sense, as float16 is mostly used because of memory limitations (arrays with billions of values can easily take several gigabytes). Windows 10 3 TkAgg 1 No response pip Refactor hist for less numerical errors Should help with Idea is to do computation on the edges rather than the widths and then do diff on the result. This may be numerically better (or not...). Or rather, it is probably numerically worse, but will give visually better results... Probably the alternative approach of providing a flag to /, making sure that adjacent bars are actually exactly adjacent may be a better approach, but I wanted to see what comes out of this first... <!-- Please mark any checkboxes that do not apply to this PR as [N/A]. --Tests and Styling [ ] Has pytest style unit tests (and passes). compliant (install and run ). Documentation [ ] New features are documented, with examples if plot related. [ ] New features have an entry in (follow instructions in there). [ ] API changes documented in (follow instructions in there). without error). <!-- Thank you so much for your PR! To help us review your contribution, please consider the following points: A development guide is available at Help with git and github is available at Do not create the PR out of main, but out of a separate branch. The PR title should summarize the changes, for example "Raise ValueError on non-numeric input to setxlim". Avoid non-descriptive titles such as "Addresses issue ". The summary should provide at least 1-2 sentences describing the pull request in detail (Why is this change required? What problem does it solve?) and link to any relevant issues. If you are contributing fixes to docstrings, please pay attention to In particular, note the difference between using single backquotes, double backquotes, and asterisks in the markup. We understand that PRs can sometimes be overwhelming, especially as the reviews start coming in. Please let us know if the reviews are unclear or the recommended next step seems overly demanding, if you would like help in addressing a reviewer's comments, or if you have been waiting too long to hear back on your PR. --

m, bins = np.histogram(x[i], bins, weights=w[i], **hist_kwargs)             tops.append(m)         tops = np.array(tops, float)  # causes problems later if it's an int<ins>        bins = np.array(bins, float)  # causes problems if float16</ins>         if stacked:             tops = tops.cumsum(axis=0)             # If a stacked density plot, normalize so the area of all the


Question: [MNT]: Should () get a minor keyword argument Extracted as remaining question from . Currently does not support a minor kwarg, in contrast to . it's not strictly necessary because pyplot may have less functionality than the OOP interface; but it doesn't hurt either. No response_

return ret  def xticks(ticks=None, labels=None, **kwargs):def xticks(ticks=None, labels=None, *, minor=False, **kwargs):     """     Get or set the current tick locations and labels of the x-axis.


Question: [MNT]: Should () get a minor keyword argument Extracted as remaining question from . Currently does not support a minor kwarg, in contrast to . it's not strictly necessary because pyplot may have less functionality than the OOP interface; but it doesn't hurt either. No response_

labels : array-like, optional         The labels to place at the given *ticks* locations.  This argument can         only be passed if *ticks* is passed as well.<ins>    minor : bool, default: False        If ``False``, get/set the major ticks/labels; if ``True``, the minor        ticks/labels.</ins>     **kwargs         `.Text` properties can be used to control the appearance of the labels.


Question: [MNT]: Should () get a minor keyword argument Extracted as remaining question from . Currently does not support a minor kwarg, in contrast to . it's not strictly necessary because pyplot may have less functionality than the OOP interface; but it doesn't hurt either. No response_

ax = gca()      if ticks is None:        locs = ax.get_xticks()        locs = ax.get_xticks(minor=minor)         if labels is not None:             raise TypeError("xticks(): Parameter 'labels' can't be set "                             "without setting 'ticks'")     else:        locs = ax.set_xticks(ticks)        locs = ax.set_xticks(ticks, minor=minor)      if labels is None:        labels = ax.get_xticklabels()        labels = ax.get_xticklabels(minor=minor)         for l in labels:             l._internal_update(kwargs)     else:        labels = ax.set_xticklabels(labels, **kwargs)        labels = ax.set_xticklabels(labels, minor=minor, **kwargs)      return locs, labels  def yticks(ticks=None, labels=None, **kwargs):def yticks(ticks=None, labels=None, *, minor=False, **kwargs):     """     Get or set the current tick locations and labels of the y-axis.


Question: [MNT]: Should () get a minor keyword argument Extracted as remaining question from . Currently does not support a minor kwarg, in contrast to . it's not strictly necessary because pyplot may have less functionality than the OOP interface; but it doesn't hurt either. No response_


Question: [MNT]: Should () get a minor keyword argument Extracted as remaining question from . Currently does not support a minor kwarg, in contrast to . it's not strictly necessary because pyplot may have less functionality than the OOP interface; but it doesn't hurt either. No response_

ax = gca()      if ticks is None:        locs = ax.get_yticks()        locs = ax.get_yticks(minor=minor)         if labels is not None:             raise TypeError("yticks(): Parameter 'labels' can't be set "                             "without setting 'ticks'")     else:        locs = ax.set_yticks(ticks)        locs = ax.set_yticks(ticks, minor=minor)      if labels is None:        labels = ax.get_yticklabels()        labels = ax.get_yticklabels(minor=minor)         for l in labels:             l._internal_update(kwargs)     else:        labels = ax.set_yticklabels(labels, **kwargs)        labels = ax.set_yticklabels(labels, minor=minor, **kwargs)      return locs, labels


Question: [Bug]: Figures fail to redraw with IPython A regression between release versions 3.5.1 and 3.5.2 causes figures to fail to redraw after an initial plot is using the interface in an interactive IPython session. This has been observed with both and . The figure will show the first plot drawn, but subsequent calls to and fail to update an on-screen figure until is invoked. This has been observed with IPython versions 8.3.0 (current) and 8.2.0. Both the Qt5 and Tk backends exhibit the same issues. the first command, a figure appears with a line shown. the second command, the figure does not update. the command, the figure updates to show both the and lines. the first command, a figure appears with a line shown. (This is as expected.) the second command, the figure updates with the addition of a line. (This is the deviation.) command should produce no visible change in the figure. This regression has been bisected to commit . The testbed is a current Void Linux system running Python 3.10.4, including the system package for a GUI. (As noted above, this bug is also present with the Qt5 backend.) All packages were installed in a virtual environment. The output of is: (Note that the funny version comes from a local git repo checked out to the problematic commit.) Void Linux x86_64 2 TkAgg, Qt5Agg 10.4 None pip

# will (re)import pyplot and then call switch_backend if we need to         # resolve the auto sentinel)         switch_backend(dict.__getitem__(rcParams, "backend"))<del>        # Just to be safe.  Interactive mode can be turned on without calling        # `plt.ion()` so register it again here.  This is safe because multiple        # calls to `install_repl_displayhook` are no-ops and the registered        # function respects `mpl.is_interactive()` to determine if it should        # trigger a draw.        install_repl_displayhook()</del>     return _backend_mod


Question: [Bug]: Figures fail to redraw with IPython A regression between release versions 3.5.1 and 3.5.2 causes figures to fail to redraw after an initial plot is using the interface in an interactive IPython session. This has been observed with both and . The figure will show the first plot drawn, but subsequent calls to and fail to update an on-screen figure until is invoked. This has been observed with IPython versions 8.3.0 (current) and 8.2.0. Both the Qt5 and Tk backends exhibit the same issues. the first command, a figure appears with a line shown. the second command, the figure does not update. the command, the figure updates to show both the and lines. the first command, a figure appears with a line shown. (This is as expected.) the second command, the figure updates with the addition of a line. (This is the deviation.) command should produce no visible change in the figure. This regression has been bisected to commit . The testbed is a current Void Linux system running Python 3.10.4, including the system package for a GUI. (As noted above, this bug is also present with the Qt5 backend.) All packages were installed in a virtual environment. The output of is: (Note that the funny version comes from a local git repo checked out to the problematic commit.) Void Linux x86_64 2 TkAgg, Qt5Agg 10.4 None pip

# See https://github.com/matplotlib/matplotlib/issues/6092     matplotlib.backends.backend = newbackend <ins>    # make sure the repl display hook is installed in case we become    # interactive    install_repl_displayhook()</ins>  def _warn_if_gui_out_of_main_thread():     if (_get_required_interactive_framework(_get_backend_mod())


Question: [Bug]: Confusing error messages Basically, plotting from a dataframe failed because of a keyerror but the message I received was regarding formatting using a string. The failure happened silently, causing me to spend over an hour tracking down a type because I had no clue where to start. Traceback (most recent call last): File "<stdin", line 1, in <moduleFile "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 1605, in plot lines = [self.getlines(args, data=data, **kwargs)] File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 315, in call yield from self.plotargs(this, kwargs) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 452, in plotargs linestyle, marker, color = processplotformat(fmt) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 188, in processplotformat raise ValueError( ValueError: Illegal format string "correctlySpelledHeader"; two color symbols The actual failure is happening when the df and key are passed into this as data and value respectively. mpl.replacer(data,value): ----try: --------# if key isn't a string don't bother --------if isinstance(value, str): --------# try to use getitem --------value = data[value] <-----------------------Key Error because of typo ----except Exception: --------# key does not exist, silently fall back to key --------pass ----return sanitizesequence(value) As you can see from the comment, this happens silently. And as you can see from the Traceback provided the error you finally receive is regarding a formatting string. So this caused quite a bit of confusion, because I was looking everywhere except my header spellings. I feel like this shouldn't happen 'silently', it at least deseves a warning, perhaps: ----except Exception: --------('KeyError generated when attempting to access data using provided str') side note: the docstring says it returns data[value] or data back. in reality it passes back data[value] or value back. Not sure what the purpose is for allowing this to slide through, but either the behavior is wrong or the docstring is. No response Ubuntu 20.04 2 Qt5Agg 1 No response No response

self._transform - ax.figure.transSubfigure)  def _process_plot_format(fmt):def _process_plot_format(fmt, *, ambiguous_fmt_datakey=False):     """     Convert a MATLAB style color/line style format string to a (*linestyle*,     *marker*, *color*) tuple.


Question: [Bug]: Confusing error messages Basically, plotting from a dataframe failed because of a keyerror but the message I received was regarding formatting using a string. The failure happened silently, causing me to spend over an hour tracking down a type because I had no clue where to start. Traceback (most recent call last): File "<stdin", line 1, in <moduleFile "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 1605, in plot lines = [self.getlines(args, data=data, **kwargs)] File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 315, in call yield from self.plotargs(this, kwargs) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 452, in plotargs linestyle, marker, color = processplotformat(fmt) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 188, in processplotformat raise ValueError( ValueError: Illegal format string "correctlySpelledHeader"; two color symbols The actual failure is happening when the df and key are passed into this as data and value respectively. mpl.replacer(data,value): ----try: --------# if key isn't a string don't bother --------if isinstance(value, str): --------# try to use getitem --------value = data[value] <-----------------------Key Error because of typo ----except Exception: --------# key does not exist, silently fall back to key --------pass ----return sanitizesequence(value) As you can see from the comment, this happens silently. And as you can see from the Traceback provided the error you finally receive is regarding a formatting string. So this caused quite a bit of confusion, because I was looking everywhere except my header spellings. I feel like this shouldn't happen 'silently', it at least deseves a warning, perhaps: ----except Exception: --------('KeyError generated when attempting to access data using provided str') side note: the docstring says it returns data[value] or data back. in reality it passes back data[value] or value back. Not sure what the purpose is for allowing this to slide through, but either the behavior is wrong or the docstring is. No response Ubuntu 20.04 2 Qt5Agg 1 No response No response

except ValueError:         pass  # No, not just a color.     errfmt = ("{!r} is neither a data key nor a valid format string ({})"              if ambiguous_fmt_datakey else              "{!r} is not a valid format string ({})")     i = 0     while i < len(fmt):         c = fmt[i]         if fmt[i:i+2] in mlines.lineStyles:  # First, the two-char styles.             if linestyle is not None:                raise ValueError(                    f'Illegal format string {fmt!r}; two linestyle symbols')                raise ValueError(errfmt.format(fmt, "two linestyle symbols"))             linestyle = fmt[i:i+2]             i += 2         elif c in mlines.lineStyles:             if linestyle is not None:                raise ValueError(                    f'Illegal format string {fmt!r}; two linestyle symbols')                raise ValueError(errfmt.format(fmt, "two linestyle symbols"))             linestyle = c             i += 1         elif c in mlines.lineMarkers:             if marker is not None:                raise ValueError(                    f'Illegal format string {fmt!r}; two marker symbols')                raise ValueError(errfmt.format(fmt, "two marker symbols"))             marker = c             i += 1         elif c in mcolors.get_named_colors_mapping():             if color is not None:                raise ValueError(                    f'Illegal format string {fmt!r}; two color symbols')                raise ValueError(errfmt.format(fmt, "two color symbols"))             color = c             i += 1         elif c == 'C' and i < len(fmt) - 1:


Question: [Bug]: Confusing error messages Basically, plotting from a dataframe failed because of a keyerror but the message I received was regarding formatting using a string. The failure happened silently, causing me to spend over an hour tracking down a type because I had no clue where to start. Traceback (most recent call last): File "<stdin", line 1, in <moduleFile "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 1605, in plot lines = [self.getlines(args, data=data, **kwargs)] File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 315, in call yield from self.plotargs(this, kwargs) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 452, in plotargs linestyle, marker, color = processplotformat(fmt) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 188, in processplotformat raise ValueError( ValueError: Illegal format string "correctlySpelledHeader"; two color symbols The actual failure is happening when the df and key are passed into this as data and value respectively. mpl.replacer(data,value): ----try: --------# if key isn't a string don't bother --------if isinstance(value, str): --------# try to use getitem --------value = data[value] <-----------------------Key Error because of typo ----except Exception: --------# key does not exist, silently fall back to key --------pass ----return sanitizesequence(value) As you can see from the comment, this happens silently. And as you can see from the Traceback provided the error you finally receive is regarding a formatting string. So this caused quite a bit of confusion, because I was looking everywhere except my header spellings. I feel like this shouldn't happen 'silently', it at least deseves a warning, perhaps: ----except Exception: --------('KeyError generated when attempting to access data using provided str') side note: the docstring says it returns data[value] or data back. in reality it passes back data[value] or value back. Not sure what the purpose is for allowing this to slide through, but either the behavior is wrong or the docstring is. No response Ubuntu 20.04 2 Qt5Agg 1 No response No response

i += 2         else:             raise ValueError(                f'Unrecognized character {c} in format string {fmt!r}')                errfmt.format(fmt, f"unrecognized character {c!r}"))      if linestyle is None and marker is None:         linestyle = mpl.rcParams['lines.linestyle']


Question: [Bug]: Confusing error messages Basically, plotting from a dataframe failed because of a keyerror but the message I received was regarding formatting using a string. The failure happened silently, causing me to spend over an hour tracking down a type because I had no clue where to start. Traceback (most recent call last): File "<stdin", line 1, in <moduleFile "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 1605, in plot lines = [self.getlines(args, data=data, **kwargs)] File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 315, in call yield from self.plotargs(this, kwargs) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 452, in plotargs linestyle, marker, color = processplotformat(fmt) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 188, in processplotformat raise ValueError( ValueError: Illegal format string "correctlySpelledHeader"; two color symbols The actual failure is happening when the df and key are passed into this as data and value respectively. mpl.replacer(data,value): ----try: --------# if key isn't a string don't bother --------if isinstance(value, str): --------# try to use getitem --------value = data[value] <-----------------------Key Error because of typo ----except Exception: --------# key does not exist, silently fall back to key --------pass ----return sanitizesequence(value) As you can see from the comment, this happens silently. And as you can see from the Traceback provided the error you finally receive is regarding a formatting string. So this caused quite a bit of confusion, because I was looking everywhere except my header spellings. I feel like this shouldn't happen 'silently', it at least deseves a warning, perhaps: ----except Exception: --------('KeyError generated when attempting to access data using provided str') side note: the docstring says it returns data[value] or data back. in reality it passes back data[value] or value back. Not sure what the purpose is for allowing this to slide through, but either the behavior is wrong or the docstring is. No response Ubuntu 20.04 2 Qt5Agg 1 No response No response

kwargs["label"] = mpl._label_from_arg(                     replaced[label_namer_idx], args[label_namer_idx])             args = replaced<ins>        ambiguous_fmt_datakey = data is not None and len(args) == 2</ins>          if len(args) >= 4 and not cbook.is_scalar_or_string(                 kwargs.get("label")):


Question: [Bug]: Confusing error messages Basically, plotting from a dataframe failed because of a keyerror but the message I received was regarding formatting using a string. The failure happened silently, causing me to spend over an hour tracking down a type because I had no clue where to start. Traceback (most recent call last): File "<stdin", line 1, in <moduleFile "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 1605, in plot lines = [self.getlines(args, data=data, **kwargs)] File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 315, in call yield from self.plotargs(this, kwargs) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 452, in plotargs linestyle, marker, color = processplotformat(fmt) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 188, in processplotformat raise ValueError( ValueError: Illegal format string "correctlySpelledHeader"; two color symbols The actual failure is happening when the df and key are passed into this as data and value respectively. mpl.replacer(data,value): ----try: --------# if key isn't a string don't bother --------if isinstance(value, str): --------# try to use getitem --------value = data[value] <-----------------------Key Error because of typo ----except Exception: --------# key does not exist, silently fall back to key --------pass ----return sanitizesequence(value) As you can see from the comment, this happens silently. And as you can see from the Traceback provided the error you finally receive is regarding a formatting string. So this caused quite a bit of confusion, because I was looking everywhere except my header spellings. I feel like this shouldn't happen 'silently', it at least deseves a warning, perhaps: ----except Exception: --------('KeyError generated when attempting to access data using provided str') side note: the docstring says it returns data[value] or data back. in reality it passes back data[value] or value back. Not sure what the purpose is for allowing this to slide through, but either the behavior is wrong or the docstring is. No response Ubuntu 20.04 2 Qt5Agg 1 No response No response

if args and isinstance(args[0], str):                 this += args[0],                 args = args[1:]            yield from self._plot_args(this, kwargs)            yield from self._plot_args(                this, kwargs, ambiguous_fmt_datakey=ambiguous_fmt_datakey)      def get_next_color(self):         """Return the next color in the cycle."""


Question: [Bug]: Confusing error messages Basically, plotting from a dataframe failed because of a keyerror but the message I received was regarding formatting using a string. The failure happened silently, causing me to spend over an hour tracking down a type because I had no clue where to start. Traceback (most recent call last): File "<stdin", line 1, in <moduleFile "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 1605, in plot lines = [self.getlines(args, data=data, **kwargs)] File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 315, in call yield from self.plotargs(this, kwargs) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 452, in plotargs linestyle, marker, color = processplotformat(fmt) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 188, in processplotformat raise ValueError( ValueError: Illegal format string "correctlySpelledHeader"; two color symbols The actual failure is happening when the df and key are passed into this as data and value respectively. mpl.replacer(data,value): ----try: --------# if key isn't a string don't bother --------if isinstance(value, str): --------# try to use getitem --------value = data[value] <-----------------------Key Error because of typo ----except Exception: --------# key does not exist, silently fall back to key --------pass ----return sanitizesequence(value) As you can see from the comment, this happens silently. And as you can see from the Traceback provided the error you finally receive is regarding a formatting string. So this caused quite a bit of confusion, because I was looking everywhere except my header spellings. I feel like this shouldn't happen 'silently', it at least deseves a warning, perhaps: ----except Exception: --------('KeyError generated when attempting to access data using provided str') side note: the docstring says it returns data[value] or data back. in reality it passes back data[value] or value back. Not sure what the purpose is for allowing this to slide through, but either the behavior is wrong or the docstring is. No response Ubuntu 20.04 2 Qt5Agg 1 No response No response

seg.set(**kwargs)         return seg, kwargs     def _plot_args(self, tup, kwargs, return_kwargs=False):    def _plot_args(self, tup, kwargs, *,                   return_kwargs=False, ambiguous_fmt_datakey=False):         """         Process the arguments of ``plot([x], y, [fmt], **kwargs)`` calls.


Question: [Bug]: Confusing error messages Basically, plotting from a dataframe failed because of a keyerror but the message I received was regarding formatting using a string. The failure happened silently, causing me to spend over an hour tracking down a type because I had no clue where to start. Traceback (most recent call last): File "<stdin", line 1, in <moduleFile "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 1605, in plot lines = [self.getlines(args, data=data, **kwargs)] File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 315, in call yield from self.plotargs(this, kwargs) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 452, in plotargs linestyle, marker, color = processplotformat(fmt) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 188, in processplotformat raise ValueError( ValueError: Illegal format string "correctlySpelledHeader"; two color symbols The actual failure is happening when the df and key are passed into this as data and value respectively. mpl.replacer(data,value): ----try: --------# if key isn't a string don't bother --------if isinstance(value, str): --------# try to use getitem --------value = data[value] <-----------------------Key Error because of typo ----except Exception: --------# key does not exist, silently fall back to key --------pass ----return sanitizesequence(value) As you can see from the comment, this happens silently. And as you can see from the Traceback provided the error you finally receive is regarding a formatting string. So this caused quite a bit of confusion, because I was looking everywhere except my header spellings. I feel like this shouldn't happen 'silently', it at least deseves a warning, perhaps: ----except Exception: --------('KeyError generated when attempting to access data using provided str') side note: the docstring says it returns data[value] or data back. in reality it passes back data[value] or value back. Not sure what the purpose is for allowing this to slide through, but either the behavior is wrong or the docstring is. No response Ubuntu 20.04 2 Qt5Agg 1 No response No response

The keyword arguments passed to ``plot()``.          return_kwargs : bool            If true, return the effective keyword arguments after label            Whether to also return the effective keyword arguments after label             unpacking as well.         ambiguous_fmt_datakey : bool            Whether the format string in *tup* could also have been a            misspelled data key.         Returns         -------         result


Question: [Bug]: Confusing error messages Basically, plotting from a dataframe failed because of a keyerror but the message I received was regarding formatting using a string. The failure happened silently, causing me to spend over an hour tracking down a type because I had no clue where to start. Traceback (most recent call last): File "<stdin", line 1, in <moduleFile "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 1605, in plot lines = [self.getlines(args, data=data, **kwargs)] File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 315, in call yield from self.plotargs(this, kwargs) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 452, in plotargs linestyle, marker, color = processplotformat(fmt) File "/home/bbriscoe/thirdparty/phel-1.2.0/linuxx86649.4.0/miniconda3-4.9.2/lib/python3.9/site-", line 188, in processplotformat raise ValueError( ValueError: Illegal format string "correctlySpelledHeader"; two color symbols The actual failure is happening when the df and key are passed into this as data and value respectively. mpl.replacer(data,value): ----try: --------# if key isn't a string don't bother --------if isinstance(value, str): --------# try to use getitem --------value = data[value] <-----------------------Key Error because of typo ----except Exception: --------# key does not exist, silently fall back to key --------pass ----return sanitizesequence(value) As you can see from the comment, this happens silently. And as you can see from the Traceback provided the error you finally receive is regarding a formatting string. So this caused quite a bit of confusion, because I was looking everywhere except my header spellings. I feel like this shouldn't happen 'silently', it at least deseves a warning, perhaps: ----except Exception: --------('KeyError generated when attempting to access data using provided str') side note: the docstring says it returns data[value] or data back. in reality it passes back data[value] or value back. Not sure what the purpose is for allowing this to slide through, but either the behavior is wrong or the docstring is. No response Ubuntu 20.04 2 Qt5Agg 1 No response No response

if len(tup) > 1 and isinstance(tup[-1], str):             # xy is tup with fmt stripped (could still be (y,) only)             *xy, fmt = tup            linestyle, marker, color = _process_plot_format(fmt)            linestyle, marker, color = _process_plot_format(                fmt, ambiguous_fmt_datakey=ambiguous_fmt_datakey)         elif len(tup) == 3:             raise ValueError('third arg must be a format string')         else:


Question: [Bug]: Imshow with all negative values leads to math domain errors. When using imshow to display a numpy array filled with identical negative values hovering the mouse over the displayed image throws math domain errors. Hovering the mouse over the plot spews math domain errors into console and stops the value and coordinate under the mouse from being displayed in the top right. ! The coordinates and values in the top right of the window are missing. ! The value area should be displayed correctly. Perhaps the delta in cbook\", line 2228, in gsigdigits (math.log10(delta))) if math.isfinite(value) else 0 is negative in this case. The errors do not occur if a single value in the array is different(negativ or positive doesn't matter). i.e. Will not error. The errors also do not occur if setclim() is used. Windows 10 .1645 1 QtAgg Python 3.9.12 No response conda

if delta == 0:         # delta = 0 may occur when trying to format values over a tiny range;         # in that case, replace it by the distance to the closest float.        delta = np.spacing(value)        delta = abs(np.spacing(value))     # If e.g. value = 45.67 and delta = 0.02, then we want to round to 2 digits     # after the decimal point (floor(log10(0.02)) = -2); 45.67 contributes 2     # digits before the decimal point (floor(log10(45.67)) + 1 = 2): the total


Question: Legend Title Left Alignment I'm trying to align my legend title on the left of the legend box. I assumed this would work: leg = ax.getlegend() titleinst = leg.gettitle() titleinst.sethorizontalalignment('left') However only this worked: leg = ax.getlegend() = "left" Seems like something is not working as expected, especially since I'm accessing something hidden.

to set the fontsize alongside other font properties, use the *size*     parameter in *title_fontproperties*. <ins>alignment : {'center', 'left', 'right'}, default: 'center'    The alignment of the legend title and the box of entries. The entries    are aligned as a single block, so that markers always lined up.</ins> borderpad : float, default: :rc:`legend.borderpad`     The fractional whitespace inside the legend border, in font-size units.


Question: Legend Title Left Alignment I'm trying to align my legend title on the left of the legend box. I assumed this would work: leg = ax.getlegend() titleinst = leg.gettitle() titleinst.sethorizontalalignment('left') However only this worked: leg = ax.getlegend() = "left" Seems like something is not working as expected, especially since I'm accessing something hidden.

frameon=None,         # draw frame         handler_map=None,         title_fontproperties=None,  # properties for the legend title<ins>        alignment="center",       # control the alignment within the legend box</ins>         *,         ncol=1  # synonym for ncols (backward compatibility)     ):


Question: Legend Title Left Alignment I'm trying to align my legend title on the left of the legend box. I assumed this would work: leg = ax.getlegend() titleinst = leg.gettitle() titleinst.sethorizontalalignment('left') However only this worked: leg = ax.getlegend() = "left" Seems like something is not working as expected, especially since I'm accessing something hidden.

)         self._set_artist_props(self.legendPatch) <ins>        _api.check_in_list(["center", "left", "right"], alignment=alignment)        self._alignment = alignment</ins>         # init with null renderer         self._init_legend_box(handles, labels, markerfirst)


Question: Legend Title Left Alignment I'm trying to align my legend title on the left of the legend box. I assumed this would work: leg = ax.getlegend() titleinst = leg.gettitle() titleinst.sethorizontalalignment('left') However only this worked: leg = ax.getlegend() = "left" Seems like something is not working as expected, especially since I'm accessing something hidden.

self._legend_title_box = TextArea("")         self._legend_box = VPacker(pad=self.borderpad * fontsize,                                    sep=self.labelspacing * fontsize,                                   align="center",                                   align=self._alignment,                                    children=[self._legend_title_box,                                              self._legend_handle_box])         self._legend_box.set_figure(self.figure)


Question: Legend Title Left Alignment I'm trying to align my legend title on the left of the legend box. I assumed this would work: leg = ax.getlegend() titleinst = leg.gettitle() titleinst.sethorizontalalignment('left') However only this worked: leg = ax.getlegend() = "left" Seems like something is not working as expected, especially since I'm accessing something hidden.

r"""Return the list of `~.text.Text`\s in the legend."""         return silent_list('Text', self.texts)     def set_alignment(self, alignment):        """        Set the alignment of the legend title and the box of entries.        The entries are aligned as a single block, so that markers always        lined up.        Parameters        ----------        alignment : {'center', 'left', 'right'}.        """        _api.check_in_list(["center", "left", "right"], alignment=alignment)        self._alignment = alignment        self._legend_box.align = alignment    def get_alignment(self):        """Get the alignment value of the legend box"""        return self._legend_box.align     def set_title(self, title, prop=None):         """        Set the legend title. Fontproperties can be optionally set        with *prop* parameter.        Set legend title and title style.        Parameters        ----------        title : str            The legend title.        prop : `.font_manager.FontProperties` or `str` or `pathlib.Path`            The font properties of the legend title.            If a `str`, it is interpreted as a fontconfig pattern parsed by            `.FontProperties`.  If a `pathlib.Path`, it is interpreted as the            absolute path to a font file.         """         self._legend_title_box._text.set_text(title)         if title:


Question: [Bug]: Crash when adding clabels to subfigures Adding a clabel to a contour plot of a subfigure results in a traceback. The two subfigures appearing side by side, each showing the Contour Demo example No response Gentoo 2 QtAgg 13 No response Linux package manager

def dpi(self, value):         self._parent.dpi = value <ins>    @property    def _cachedRenderer(self):        return self._parent._cachedRenderer    @_cachedRenderer.setter    def _cachedRenderer(self, renderer):        self._parent._cachedRenderer = renderer</ins>     def _redo_transform_rel_fig(self, bbox=None):         """         Make the transSubfigure bbox relative to Figure transform.


Question: [MNT]: default date limits... The default date limits are 2000-01-01 to 2010-01-01. This leads to problems as a default if folks add for instance day tickers without specifying the limits. See for instance: We can change these to 1970-01-01 to 1970-01-02. For the default date epoch, this would yield default limits of 0-1 in our float conversion. If folks use the old epoch (0000-01-01), it would still work, but of course be something much larger than 0-1. This should only affect empty date axes, not any axes that folks have actually data to. If I make this change on main, the only tests that fail are empty axes tests.

if it is too close to being singular (i.e. a range of ~0).         """         if not np.isfinite(vmin) or not np.isfinite(vmax):            # Except if there is no data, then use 2000-2010 as default.            return (date2num(datetime.date(2000, 1, 1)),                    date2num(datetime.date(2010, 1, 1)))            # Except if there is no data, then use 1970 as default.            return (date2num(datetime.date(1970, 1, 1)),                    date2num(datetime.date(1970, 1, 2)))         if vmax < vmin:             vmin, vmax = vmax, vmin         unit = self._get_unit()


Question: [MNT]: default date limits... The default date limits are 2000-01-01 to 2010-01-01. This leads to problems as a default if folks add for instance day tickers without specifying the limits. See for instance: We can change these to 1970-01-01 to 1970-01-02. For the default date epoch, this would yield default limits of 0-1 in our float conversion. If folks use the old epoch (0000-01-01), it would still work, but of course be something much larger than 0-1. This should only affect empty date axes, not any axes that folks have actually data to. If I make this change on main, the only tests that fail are empty axes tests.

# whatever is thrown at us, we can scale the unit.         # But default nonsingular date plots at an ~4 year period.         if not np.isfinite(vmin) or not np.isfinite(vmax):            # Except if there is no data, then use 2000-2010 as default.            return (date2num(datetime.date(2000, 1, 1)),                    date2num(datetime.date(2010, 1, 1)))            # Except if there is no data, then use 1970 as default.            return (date2num(datetime.date(1970, 1, 1)),                    date2num(datetime.date(1970, 1, 2)))         if vmax < vmin:             vmin, vmax = vmax, vmin         if vmin == vmax:


Question: [MNT]: default date limits... The default date limits are 2000-01-01 to 2010-01-01. This leads to problems as a default if folks add for instance day tickers without specifying the limits. See for instance: We can change these to 1970-01-01 to 1970-01-02. For the default date epoch, this would yield default limits of 0-1 in our float conversion. If folks use the old epoch (0000-01-01), it would still work, but of course be something much larger than 0-1. This should only affect empty date axes, not any axes that folks have actually data to. If I make this change on main, the only tests that fail are empty axes tests.

majloc = AutoDateLocator(tz=tz,                                  interval_multiples=self._interval_multiples)         majfmt = AutoDateFormatter(majloc, tz=tz)        datemin = datetime.date(2000, 1, 1)        datemax = datetime.date(2010, 1, 1)        datemin = datetime.date(1970, 1, 1)        datemax = datetime.date(1970, 1, 2)          return units.AxisInfo(majloc=majloc, majfmt=majfmt, label='',                               default_limits=(datemin, datemax))


Question: [MNT]: default date limits... The default date limits are 2000-01-01 to 2010-01-01. This leads to problems as a default if folks add for instance day tickers without specifying the limits. See for instance: We can change these to 1970-01-01 to 1970-01-02. For the default date epoch, this would yield default limits of 0-1 in our float conversion. If folks use the old epoch (0000-01-01), it would still work, but of course be something much larger than 0-1. This should only affect empty date axes, not any axes that folks have actually data to. If I make this change on main, the only tests that fail are empty axes tests.

zero_formats=self._zero_formats,                                       offset_formats=self._offset_formats,                                       show_offset=self._show_offset)        datemin = datetime.date(2000, 1, 1)        datemax = datetime.date(2010, 1, 1)        datemin = datetime.date(1970, 1, 1)        datemax = datetime.date(1970, 1, 2)         return units.AxisInfo(majloc=majloc, majfmt=majfmt, label='',                               default_limits=(datemin, datemax))


Question: Inconsistency in keyword-arguments ncol/ncols, nrow/nrows I find it quite inconsistent that one sometimes has to specify and sometimes . For example: while (Likewise for /)

# re-generate legend, if checkbox is checked         if generate_legend:             draggable = None            ncol = 1            ncols = 1             if axes.legend_ is not None:                 old_legend = axes.get_legend()                 draggable = old_legend._draggable is not None                ncol = old_legend._ncol            new_legend = axes.legend(ncol=ncol)                ncols = old_legend._ncols            new_legend = axes.legend(ncols=ncols)             if new_legend:                 new_legend.set_draggable(draggable) diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py-- a/lib/matplotlib/legend.py++ b/lib/matplotlib/legend.py


Question: Inconsistency in keyword-arguments ncol/ncols, nrow/nrows I find it quite inconsistent that one sometimes has to specify and sometimes . For example: while (Likewise for /)

loc='upper right', bbox_to_anchor=(0.5, 0.5) ncol : int, default: 1ncols : int, default: 1     The number of columns that the legend has.     For backward compatibility, the spelling *ncol* is also supported    but it is discouraged. If both are given, *ncols* takes precedence. prop : None or `matplotlib.font_manager.FontProperties` or dict     The font properties of the legend. If None (default), the current     :data:`matplotlib.rcParams` will be used.


Question: Inconsistency in keyword-arguments ncol/ncols, nrow/nrows I find it quite inconsistent that one sometimes has to specify and sometimes . For example: while (Likewise for /)

borderaxespad=None,  # pad between the axes and legend border         columnspacing=None,  # spacing between columns         ncol=1,     # number of columns        ncols=1,     # number of columns         mode=None,  # horizontal distribution of columns: None or "expand"          fancybox=None,  # True: fancy box, False: rounded box, None: rcParam


Question: Inconsistency in keyword-arguments ncol/ncols, nrow/nrows I find it quite inconsistent that one sometimes has to specify and sometimes . For example: while (Likewise for /)

frameon=None,         # draw frame         handler_map=None,         title_fontproperties=None,  # properties for the legend title<ins>        *,        ncol=1  # synonym for ncols (backward compatibility)</ins>     ):         """         Parameters


Question: Inconsistency in keyword-arguments ncol/ncols, nrow/nrows I find it quite inconsistent that one sometimes has to specify and sometimes . For example: while (Likewise for /)

handles = list(handles)         if len(handles) < 2:            ncol = 1        self._ncol = ncol            ncols = 1        self._ncols = ncols if ncols != 1 else ncol          if self.numpoints <= 0:             raise ValueError("numpoints must be > 0; it was %d" % numpoints)


Question: Inconsistency in keyword-arguments ncol/ncols, nrow/nrows I find it quite inconsistent that one sometimes has to specify and sometimes . For example: while (Likewise for /)

self.stale = True         self._legend_box.set_offset(self._findoffset) <ins>    def set_ncols(self, ncols):        """Set the number of columns."""        self._ncols = ncols</ins>     def _get_loc(self):         return self._loc_real


Question: Inconsistency in keyword-arguments ncol/ncols, nrow/nrows I find it quite inconsistent that one sometimes has to specify and sometimes . For example: while (Likewise for /)

handles_and_labels.append((handlebox, textbox))          columnbox = []        # array_split splits n handles_and_labels into ncol columns, with the        # first n%ncol columns having an extra entry.  filter(len, ...) handles        # the case where n < ncol: the last ncol-n columns are empty and get        # filtered out.        for handles_and_labels_column \                in filter(len, np.array_split(handles_and_labels, self._ncol)):        # array_split splits n handles_and_labels into ncols columns, with the        # first n%ncols columns having an extra entry.  filter(len, ...)        # handles the case where n < ncols: the last ncols-n columns are empty        # and get filtered out.        for handles_and_labels_column in filter(                len, np.array_split(handles_and_labels, self._ncols)):             # pack handlebox and labelbox into itembox             itemboxes = [HPacker(pad=0,                                  sep=self.handletextpad * fontsize,


Question: [Bug]: colorbar ignores keyword panchor=False seems to ignore the keyword setting My reading of the is that the axes anchor should still be "N" after I add the colorbar. Though given , it's possible I have misunderstood! No response No response branch (3.6.0.dev2341+g3df958c760), 3.5.2 and some older (3.3+) versions. No response No response No response No response

aspect = 1 / aspect      parent.set_subplotspec(ss_main)    parent.set_anchor(loc_settings["panchor"])    if panchor is not False:        parent.set_anchor(panchor)      fig = parent.get_figure()     cax = fig.add_subplot(ss_cb, label="<colorbar>")


Question: [ENH]: contour kwarg for negativelinestyle if you contour a negative quantity, it gets dashed lines. Leaving aside whether this is a good default or not, the only way to toggle this is via . I think this should be togglable via kwarg, though I appreciate that overlaps with and only is activated with monochrome contours. (I actually think the default should be False, FWIW - this surprises me every time, and I make quite a few contour plots).

hatches=(None,), alpha=None, origin=None, extent=None,                  cmap=None, colors=None, norm=None, vmin=None, vmax=None,                  extend='neither', antialiased=None, nchunk=0, locator=None,                 transform=None,                 transform=None, negative_linestyles=None,                  **kwargs):         """         Draw contour lines or filled regions, depending on


Question: [ENH]: contour kwarg for negativelinestyle if you contour a negative quantity, it gets dashed lines. Leaving aside whether this is a good default or not, the only way to toggle this is via . I think this should be togglable via kwarg, though I appreciate that overlaps with and only is activated with monochrome contours. (I actually think the default should be False, FWIW - this surprises me every time, and I make quite a few contour plots).

self._transform = transform <ins>        self.negative_linestyles = negative_linestyles        # If negative_linestyles was not defined as a kwarg,        # define negative_linestyles with rcParams        if self.negative_linestyles is None:            self.negative_linestyles = \                mpl.rcParams['contour.negative_linestyle']</ins>         kwargs = self._process_args(*args, **kwargs)         self._process_levels()


Question: [ENH]: contour kwarg for negativelinestyle if you contour a negative quantity, it gets dashed lines. Leaving aside whether this is a good default or not, the only way to toggle this is via . I think this should be togglable via kwarg, though I appreciate that overlaps with and only is activated with monochrome contours. (I actually think the default should be False, FWIW - this surprises me every time, and I make quite a few contour plots).

if linestyles is None:             tlinestyles = ['solid'] * Nlev             if self.monochrome:                neg_ls = mpl.rcParams['contour.negative_linestyle']                 eps = - (self.zmax - self.zmin) * 1e-15                 for i, lev in enumerate(self.levels):                     if lev < eps:                        tlinestyles[i] = neg_ls                        tlinestyles[i] = self.negative_linestyles         else:             if isinstance(linestyles, str):                 tlinestyles = [linestyles] * Nlev


Question: [ENH]: contour kwarg for negativelinestyle if you contour a negative quantity, it gets dashed lines. Leaving aside whether this is a good default or not, the only way to toggle this is via . I think this should be togglable via kwarg, though I appreciate that overlaps with and only is activated with monochrome contours. (I actually think the default should be False, FWIW - this surprises me every time, and I make quite a few contour plots).

iterable is shorter than the number of contour levels     it will be repeated as necessary. <ins>negative_linestyles : {*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, \                       optional    *Only applies to* `.contour`.    If *negative_linestyles* is None, the default is 'dashed' for    negative contours.    *negative_linestyles* can also be an iterable of the above    strings specifying a set of linestyles to be used. If this    iterable is shorter than the number of contour levels    it will be repeated as necessary.</ins> hatches : list[str], optional     *Only applies to* `.contourf`.


Question: [ENH]: Colorbar should support location kwarg that sets both orientation and ticklocation When colorbar autocreates an Axes, one can pass , which also sets the colorbar's orientation and the ticklocation (left for a left colorbar, right for a right colorbar, etc.). When one instead passes a manually created Axes (e.g. using insetaxes, as suggested by the example), the kwarg is not accepted (because things are directly passed to the Colorbar class); one needs to explicitly set and (the latter is not even documented by ): Add a kwarg to the Colorbar constructor which sets both and , and is mutually exclusive with them. ... or at least better document the workaround.

alpha : float         The colorbar transparency between 0 (transparent) and 1 (opaque).     orientation : {'vertical', 'horizontal'}    orientation : None or {'vertical', 'horizontal'}        If None, use the value determined by *location*. If both        *orientation* and *location* are None then defaults to 'vertical'.      ticklocation : {'auto', 'left', 'right', 'top', 'bottom'}        The location of the colorbar ticks. The *ticklocation* must match        *orientation*. For example, a horizontal colorbar can only have ticks        at the top or the bottom. If 'auto', the ticks will be the same as        *location*, so a colorbar to the left will have ticks to the left. If        *location* is None, the ticks will be at the bottom for a horizontal        colorbar and at the right for a vertical.      drawedges : bool        Whether to draw lines at color boundaries.      filled : bool     %(_colormap_kw_doc)s    location : None or {'left', 'right', 'top', 'bottom'}        Set the *orientation* and *ticklocation* of the colorbar using a        single argument. Colorbars on the left and right are vertical,        colorbars at the top and bottom are horizontal. The *ticklocation* is        the same as *location*, so if *location* is 'top', the ticks are on        the top. *orientation* and/or *ticklocation* can be provided as well        and overrides the value set by *location*, but there will be an error        for incompatible combinations.        .. versionadded:: 3.7     """      n_rasterize = 50  # rasterize solids if number of colors >= n_rasterize


Question: [ENH]: Colorbar should support location kwarg that sets both orientation and ticklocation When colorbar autocreates an Axes, one can pass , which also sets the colorbar's orientation and the ticklocation (left for a left colorbar, right for a right colorbar, etc.). When one instead passes a manually created Axes (e.g. using insetaxes, as suggested by the example), the kwarg is not accepted (because things are directly passed to the Colorbar class); one needs to explicitly set and (the latter is not even documented by ): Add a kwarg to the Colorbar constructor which sets both and , and is mutually exclusive with them. ... or at least better document the workaround.

alpha=None,                  values=None,                  boundaries=None,                 orientation='vertical',                 orientation=None,                  ticklocation='auto',                  extend=None,                  spacing='uniform',  # uniform or proportional


Question: [ENH]: Colorbar should support location kwarg that sets both orientation and ticklocation When colorbar autocreates an Axes, one can pass , which also sets the colorbar's orientation and the ticklocation (left for a left colorbar, right for a right colorbar, etc.). When one instead passes a manually created Axes (e.g. using insetaxes, as suggested by the example), the kwarg is not accepted (because things are directly passed to the Colorbar class); one needs to explicitly set and (the latter is not even documented by ): Add a kwarg to the Colorbar constructor which sets both and , and is mutually exclusive with them. ... or at least better document the workaround.

extendfrac=None,                  extendrect=False,                  label='',<ins>                 location=None,</ins>                  ):          if mappable is None:


Question: [ENH]: Colorbar should support location kwarg that sets both orientation and ticklocation When colorbar autocreates an Axes, one can pass , which also sets the colorbar's orientation and the ticklocation (left for a left colorbar, right for a right colorbar, etc.). When one instead passes a manually created Axes (e.g. using insetaxes, as suggested by the example), the kwarg is not accepted (because things are directly passed to the Colorbar class); one needs to explicitly set and (the latter is not even documented by ): Add a kwarg to the Colorbar constructor which sets both and , and is mutually exclusive with them. ... or at least better document the workaround.

mappable.colorbar_cid = mappable.callbacks.connect(             'changed', self.update_normal)         location_orientation = _get_orientation_from_location(location)         _api.check_in_list(            ['vertical', 'horizontal'], orientation=orientation)            [None, 'vertical', 'horizontal'], orientation=orientation)         _api.check_in_list(             ['auto', 'left', 'right', 'top', 'bottom'],             ticklocation=ticklocation)         _api.check_in_list(             ['uniform', 'proportional'], spacing=spacing)         if location_orientation is not None and orientation is not None:            if location_orientation != orientation:                raise TypeError(                    "location and orientation are mutually exclusive")        else:            orientation = orientation or location_orientation or "vertical"         self.ax = ax         self.ax._axes_locator = _ColorbarAxesLocator(self)


Question: [ENH]: Colorbar should support location kwarg that sets both orientation and ticklocation When colorbar autocreates an Axes, one can pass , which also sets the colorbar's orientation and the ticklocation (left for a left colorbar, right for a right colorbar, etc.). When one instead passes a manually created Axes (e.g. using insetaxes, as suggested by the example), the kwarg is not accepted (because things are directly passed to the Colorbar class); one needs to explicitly set and (the latter is not even documented by ): Add a kwarg to the Colorbar constructor which sets both and , and is mutually exclusive with them. ... or at least better document the workaround.

self.__scale = None  # linear, log10 for now.  Hopefully more?          if ticklocation == 'auto':            ticklocation = 'bottom' if orientation == 'horizontal' else 'right'            ticklocation = _get_ticklocation_from_orientation(                orientation) if location is None else location         self.ticklocation = ticklocation          self.set_label(label)


Question: [ENH]: Colorbar should support location kwarg that sets both orientation and ticklocation When colorbar autocreates an Axes, one can pass , which also sets the colorbar's orientation and the ticklocation (left for a left colorbar, right for a right colorbar, etc.). When one instead passes a manually created Axes (e.g. using insetaxes, as suggested by the example), the kwarg is not accepted (because things are directly passed to the Colorbar class); one needs to explicitly set and (the latter is not even documented by ): Add a kwarg to the Colorbar constructor which sets both and , and is mutually exclusive with them. ... or at least better document the workaround.

def _normalize_location_orientation(location, orientation):     if location is None:        location = _api.check_getitem(            {None: "right", "vertical": "right", "horizontal": "bottom"},            orientation=orientation)        location = _get_ticklocation_from_orientation(orientation)     loc_settings = _api.check_getitem({        "left":   {"location": "left", "orientation": "vertical",                   "anchor": (1.0, 0.5), "panchor": (0.0, 0.5), "pad": 0.10},        "right":  {"location": "right", "orientation": "vertical",                   "anchor": (0.0, 0.5), "panchor": (1.0, 0.5), "pad": 0.05},        "top":    {"location": "top", "orientation": "horizontal",                   "anchor": (0.5, 0.0), "panchor": (0.5, 1.0), "pad": 0.05},        "bottom": {"location": "bottom", "orientation": "horizontal",                   "anchor": (0.5, 1.0), "panchor": (0.5, 0.0), "pad": 0.15},        "left":   {"location": "left", "anchor": (1.0, 0.5),                   "panchor": (0.0, 0.5), "pad": 0.10},        "right":  {"location": "right", "anchor": (0.0, 0.5),                   "panchor": (1.0, 0.5), "pad": 0.05},        "top":    {"location": "top", "anchor": (0.5, 0.0),                   "panchor": (0.5, 1.0), "pad": 0.05},        "bottom": {"location": "bottom", "anchor": (0.5, 1.0),                   "panchor": (0.5, 0.0), "pad": 0.15},     }, location=location)    loc_settings["orientation"] = _get_orientation_from_location(location)     if orientation is not None and orientation != loc_settings["orientation"]:         # Allow the user to pass both if they are consistent.         raise TypeError("location and orientation are mutually exclusive")     return loc_settings  def _get_orientation_from_location(location):    return _api.check_getitem(        {None: None, "left": "vertical", "right": "vertical",         "top": "horizontal", "bottom": "horizontal"}, location=location)def _get_ticklocation_from_orientation(orientation):    return _api.check_getitem(        {None: "right", "vertical": "right", "horizontal": "bottom"},        orientation=orientation) @_docstring.interpd def make_axes(parents, location=None, orientation=None, fraction=0.15,               shrink=1.0, aspect=20, **kwargs):


Question: [Bug]: URL-area not rotated in PDFs The URL-sensitive area is not rotated in the PDF output Note that the link area is still the horizontal part as if the text was not rotated (this makes sense from reading the code). Clicking on the text, not where the non-rotated text would have been would activate the URL. In this is described in 12.5.6.5 From PDF version 1.6 it is possible to specify a "QuadPoints", i.e. a "rectangle" with four corners rather than just x, y, height, width as the current Rect has. However it says: it, the region specified by the Rect entry should be used. QuadPoints shall be ignored if any coordinate in the array lies outside the region specified by Rect. So one would also need to provide a larger Rect, which, for viewers not supporting QuadPoints will lead to that the total rectangle outlined by the rotated text will be clickable. This also holds for mathtexts. No response main No response No response No response_ git checkout

return r  <ins>def _calculate_quad_point_coordinates(x, y, width, height, angle=0):    """    Calculate the coordinates of rectangle when rotated by angle around x, y    """    angle = math.radians(-angle)    sin_angle = math.sin(angle)    cos_angle = math.cos(angle)    a = x + height * sin_angle    b = y + height * cos_angle    c = x + width * cos_angle + height * sin_angle    d = y - width * sin_angle + height * cos_angle    e = x + width * cos_angle    f = y - width * sin_angle    return ((x, y), (e, f), (c, d), (a, b))def _get_coordinates_of_block(x, y, width, height, angle=0):    """    Get the coordinates of rotated rectangle and rectangle that covers the    rotated rectangle.    """    vertices = _calculate_quad_point_coordinates(x, y, width,                                                 height, angle)    # Find min and max values for rectangle    # adjust so that QuadPoints is inside Rect    # PDF docs says that QuadPoints should be ignored if any point lies    # outside Rect, but for Acrobat it is enough that QuadPoints is on the    # border of Rect.    pad = 0.00001 if angle % 90 else 0    min_x = min(v[0] for v in vertices) - pad    min_y = min(v[1] for v in vertices) - pad    max_x = max(v[0] for v in vertices) + pad    max_y = max(v[1] for v in vertices) + pad    return (tuple(itertools.chain.from_iterable(vertices)),            (min_x, min_y, max_x, max_y))def _get_link_annotation(gc, x, y, width, height, angle=0):    """    Create a link annotation object for embedding URLs.    """    quadpoints, rect = _get_coordinates_of_block(x, y, width, height, angle)    link_annotation = {        'Type': Name('Annot'),        'Subtype': Name('Link'),        'Rect': rect,        'Border': [0, 0, 0],        'A': {            'S': Name('URI'),            'URI': gc.get_url(),        },    }    if angle % 90:        # Add QuadPoints        link_annotation['QuadPoints'] = quadpoints    return link_annotation</ins> def pdfRepr(obj):     """Map Python objects to PDF syntax."""


Question: [Bug]: URL-area not rotated in PDFs The URL-sensitive area is not rotated in the PDF output Note that the link area is still the horizontal part as if the text was not rotated (this makes sense from reading the code). Clicking on the text, not where the non-rotated text would have been would activate the URL. In this is described in 12.5.6.5 From PDF version 1.6 it is possible to specify a "QuadPoints", i.e. a "rectangle" with four corners rather than just x, y, height, width as the current Rect has. However it says: it, the region specified by the Rect entry should be used. QuadPoints shall be ignored if any coordinate in the array lies outside the region specified by Rect. So one would also need to provide a larger Rect, which, for viewers not supporting QuadPoints will lead to that the total rectangle outlined by the rotated text will be clickable. This also holds for mathtexts. No response main No response No response No response_ git checkout

self._text2path.mathtext_parser.parse(s, 72, prop)          if gc.get_url() is not None:            link_annotation = {                'Type': Name('Annot'),                'Subtype': Name('Link'),                'Rect': (x, y, x + width, y + height),                'Border': [0, 0, 0],                'A': {                    'S': Name('URI'),                    'URI': gc.get_url(),                },            }            self.file._annotations[-1][1].append(link_annotation)            self.file._annotations[-1][1].append(_get_link_annotation(                gc, x, y, width, height, angle))          fonttype = mpl.rcParams['pdf.fonttype']


Question: [Bug]: URL-area not rotated in PDFs The URL-sensitive area is not rotated in the PDF output Note that the link area is still the horizontal part as if the text was not rotated (this makes sense from reading the code). Clicking on the text, not where the non-rotated text would have been would activate the URL. In this is described in 12.5.6.5 From PDF version 1.6 it is possible to specify a "QuadPoints", i.e. a "rectangle" with four corners rather than just x, y, height, width as the current Rect has. However it says: it, the region specified by the Rect entry should be used. QuadPoints shall be ignored if any coordinate in the array lies outside the region specified by Rect. So one would also need to provide a larger Rect, which, for viewers not supporting QuadPoints will lead to that the total rectangle outlined by the rotated text will be clickable. This also holds for mathtexts. No response main No response No response No response_ git checkout

page, = dvi          if gc.get_url() is not None:            link_annotation = {                'Type': Name('Annot'),                'Subtype': Name('Link'),                'Rect': (x, y, x + page.width, y + page.height),                'Border': [0, 0, 0],                'A': {                    'S': Name('URI'),                    'URI': gc.get_url(),                },            }            self.file._annotations[-1][1].append(link_annotation)            self.file._annotations[-1][1].append(_get_link_annotation(                gc, x, y, page.width, page.height, angle))          # Gather font information and do some setup for combining         # characters into strings. The variable seq will contain a


Question: [Bug]: URL-area not rotated in PDFs The URL-sensitive area is not rotated in the PDF output Note that the link area is still the horizontal part as if the text was not rotated (this makes sense from reading the code). Clicking on the text, not where the non-rotated text would have been would activate the URL. In this is described in 12.5.6.5 From PDF version 1.6 it is possible to specify a "QuadPoints", i.e. a "rectangle" with four corners rather than just x, y, height, width as the current Rect has. However it says: it, the region specified by the Rect entry should be used. QuadPoints shall be ignored if any coordinate in the array lies outside the region specified by Rect. So one would also need to provide a larger Rect, which, for viewers not supporting QuadPoints will lead to that the total rectangle outlined by the rotated text will be clickable. This also holds for mathtexts. No response main No response No response No response_ git checkout

if gc.get_url() is not None:             font.set_text(s)             width, height = font.get_width_height()            link_annotation = {                'Type': Name('Annot'),                'Subtype': Name('Link'),                'Rect': (x, y, x + width / 64, y + height / 64),                'Border': [0, 0, 0],                'A': {                    'S': Name('URI'),                    'URI': gc.get_url(),                },            }            self.file._annotations[-1][1].append(link_annotation)            self.file._annotations[-1][1].append(_get_link_annotation(                gc, x, y, width / 64, height / 64, angle))          # If fonttype is neither 3 nor 42, emit the whole string at once         # without manual kerning.


Question: [Bug]: getbackend() clears figures from if they were created under rccontext calling removes all figures from if the first figure in was created in an . The figure should not be missing from . Consequences of this are, e.g, doesn't work because can't find it. No response_ Xubuntu 2 QtAgg Python 3.10.4 n/a conda

"""     Return a context manager for temporarily changing rcParams. <ins>    The :rc:`backend` will not be reset by the context manager.</ins>     Parameters     ----------     rc : dict


Question: [Bug]: getbackend() clears figures from if they were created under rccontext calling removes all figures from if the first figure in was created in an . The figure should not be missing from . Consequences of this are, e.g, doesn't work because can't find it. No response_ Xubuntu 2 QtAgg Python 3.10.4 n/a conda

plt.plot(x, y)  # uses 'print.rc'      """    orig = rcParams.copy()    orig = dict(rcParams.copy())    del orig['backend']     try:         if fname:             rc_file(fname)


Question: [Bug]: setvisible() not working for 3d projection in the subplot projection="3d" the setvisible function doesn't work even if the value is set to False the subplot remains visible which should not happen if the value is set to False the subplot is not visible if the value is set to False No response No response 2 Qt5Agg 10 No response No response

@martist.allow_rasterization     def draw(self, renderer):<ins>        if not self.get_visible():            return</ins>         self._unstale_viewLim()          # draw the background patch


Question: Certain non-hashable parameters to text() give cryptic error messages <!--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 Per the title. See as well. Code for reproduction <!--A minimum code snippet required to reproduce the bug. Please make sure to minimize the number of dependencies required, and provide any necessary plotted data. Avoid using threads, as Matplotlib is (explicitly) not thread-safe.--all fail with Actual outcome see above Expected outcome Error out in the setter instead. Matplotlib version <!--Please specify your platform and versions of the relevant libraries you are using:--Operating system: linux Matplotlib version: (): master Matplotlib backend (): any Python version: 38 Jupyter version (if applicable): Other libraries: <!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--<!--If you installed from conda, please specify which channel you used if not the default--

import functools import logging import mathimport numbersfrom numbers import Real import weakref  import numpy as np


Question: Certain non-hashable parameters to text() give cryptic error messages <!--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 Per the title. See as well. Code for reproduction <!--A minimum code snippet required to reproduce the bug. Please make sure to minimize the number of dependencies required, and provide any necessary plotted data. Avoid using threads, as Matplotlib is (explicitly) not thread-safe.--all fail with Actual outcome see above Expected outcome Error out in the setter instead. Matplotlib version <!--Please specify your platform and versions of the relevant libraries you are using:--Operating system: linux Matplotlib version: (): master Matplotlib backend (): any Python version: 38 Jupyter version (if applicable): Other libraries: <!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--<!--If you installed from conda, please specify which channel you used if not the default--

self._renderer = None         if linespacing is None:             linespacing = 1.2  # Maybe use rcParam later.        self._linespacing = linespacing        self.set_linespacing(linespacing)         self.set_rotation_mode(rotation_mode)         self.update(kwargs)


Question: Certain non-hashable parameters to text() give cryptic error messages <!--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 Per the title. See as well. Code for reproduction <!--A minimum code snippet required to reproduce the bug. Please make sure to minimize the number of dependencies required, and provide any necessary plotted data. Avoid using threads, as Matplotlib is (explicitly) not thread-safe.--all fail with Actual outcome see above Expected outcome Error out in the setter instead. Matplotlib version <!--Please specify your platform and versions of the relevant libraries you are using:--Operating system: linux Matplotlib version: (): master Matplotlib backend (): any Python version: 38 Jupyter version (if applicable): Other libraries: <!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--<!--If you installed from conda, please specify which channel you used if not the default--

----------         spacing : float (multiple of font size)         """<ins>        _api.check_isinstance(Real, spacing=spacing)</ins>         self._linespacing = spacing         self.stale = True


Question: Certain non-hashable parameters to text() give cryptic error messages <!--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 Per the title. See as well. Code for reproduction <!--A minimum code snippet required to reproduce the bug. Please make sure to minimize the number of dependencies required, and provide any necessary plotted data. Avoid using threads, as Matplotlib is (explicitly) not thread-safe.--all fail with Actual outcome see above Expected outcome Error out in the setter instead. Matplotlib version <!--Please specify your platform and versions of the relevant libraries you are using:--Operating system: linux Matplotlib version: (): master Matplotlib backend (): any Python version: 38 Jupyter version (if applicable): Other libraries: <!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--<!--If you installed from conda, please specify which channel you used if not the default--

The rotation angle in degrees in mathematically positive direction             (counterclockwise). 'horizontal' equals 0, 'vertical' equals 90.         """        if isinstance(s, numbers.Real):        if isinstance(s, Real):             self._rotation = float(s) % 360         elif cbook._str_equal(s, 'horizontal') or s is None:             self._rotation = 0.


Question: MultiCursor should be able to bind to axes in more than one figure... Multicursor only works if all the axes are in the same figure... Originally posted by in and possible solution: Originally posted by in

Showing a cursor on multiple plots simultaneously. This example generates two subplots and on hovering the cursor over data in onesubplot, the values of that datapoint are shown in both respectively.This example generates three axes split over two different figures.  Onhovering the cursor over data in one subplot, the values of that datapoint areshown in all axes. """ import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import MultiCursor  t = np.arange(0.0, 2.0, 0.01) s1 = np.sin(2*np.pi*t)s2 = np.sin(4*np.pi*t)s2 = np.sin(3*np.pi*t)s3 = np.sin(4*np.pi*t)  fig, (ax1, ax2) = plt.subplots(2, sharex=True) ax1.plot(t, s1) ax2.plot(t, s2)fig, ax3 = plt.subplots()ax3.plot(t, s3) multi = MultiCursor(fig.canvas, (ax1, ax2), color='r', lw=1)multi = MultiCursor(None, (ax1, ax2, ax3), color='r', lw=1) plt.show()  #############################################################################diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py-- a/lib/matplotlib/widgets.py++ b/lib/matplotlib/widgets.py


Question: MultiCursor should be able to bind to axes in more than one figure... Multicursor only works if all the axes are in the same figure... Originally posted by in and possible solution: Originally posted by in

Parameters     ----------    canvas : `matplotlib.backend_bases.FigureCanvasBase`        The FigureCanvas that contains all the Axes.    canvas : object        This parameter is entirely unused and only kept for back-compatibility.      axes : list of `matplotlib.axes.Axes`         The `~.axes.Axes` to attach the cursor to.


Question: MultiCursor should be able to bind to axes in more than one figure... Multicursor only works if all the axes are in the same figure... Originally posted by in and possible solution: Originally posted by in

See :doc:`/gallery/widgets/multicursor`.     """     @_api.make_keyword_only("3.6", "useblit")     def __init__(self, canvas, axes, useblit=True, horizOn=False, vertOn=True,                  **lineprops):        self.canvas = canvas        # canvas is stored only to provide the deprecated .canvas attribute;        # once it goes away the unused argument won't need to be stored at all.        self._canvas = canvas         self.axes = axes         self.horizOn = horizOn         self.vertOn = vertOn         self._canvas_infos = {            ax.figure.canvas: {"cids": [], "background": None} for ax in axes}         xmin, xmax = axes[-1].get_xlim()         ymin, ymax = axes[-1].get_ylim()         xmid = 0.5 * (xmin + xmax)         ymid = 0.5 * (ymin + ymax)          self.visible = True        self.useblit = useblit and self.canvas.supports_blit        self.background = None        self.useblit = (            useblit            and all(canvas.supports_blit for canvas in self._canvas_infos))         self.needclear = False          if self.useblit: