Skip to content

[Bug]: Missing backcompat for backends not supporting hatchcolors in draw_quad_mesh #29883

Closed

Description

@anntzer

Bug summary

#29044 added a hatchcolors kwarg to backends' draw_path_collection and draw_quad_mesh; this includes an backcompat/escape hatch in draw_path_collection for third-party backends (e.g., mplcairo) that don't support for that kwarg (see discussion around #29044 (comment) for why I think this should be in matplotlib and not in mplcairo); unfortunately the same escape hatch is also needed for draw_quad_mesh and is missing there.

Code for reproduction

# using mplcairo.qt, for example
from pylab import *; hist2d(rand(10), rand(10))

Actual outcome

traceback with

[...]
TypeError: draw_quad_mesh(): incompatible function arguments. The following argument types are supported:
    1. (self: mplcairo._mplcairo.GraphicsContextRendererCairo, arg0: mplcairo._mplcairo.GraphicsContextRendererCairo, arg1: object, arg2: int, arg3: int, arg4: numpy.ndarray[numpy.float64], arg5: numpy.ndarray[numpy.float64], arg6: object, arg7: numpy.ndarray[numpy.float64], arg8: object, arg9: numpy.ndarray[numpy.float64]) -> None

Invoked with:
[...] kwargs: hatchcolors=[...]

Expected outcome

no error

Additional information

No response

Operating system

any

Matplotlib Version

3.11.0.dev612+g77993d5536

Matplotlib Backend

module://mplcairo.qt

Python version

3.13

Jupyter version

no

Installation

git checkout

Activity

  1. added
    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
    on Apr 7, 2025
  2. added this to the v3.11.0 milestone on Apr 8, 2025
  3. r3kste commented on Apr 11, 2025

    @r3kste
    Contributor

    It looks like QuadMesh doesn't actually support hatching? (need confirmation). If this is the case, then it would make sense to remove the hatchcolors parameter from draw_quad_mesh().

    patch: r3kste@41a049a

  4. timhoffm commented on Apr 11, 2025

    @timhoffm
    Member

    @r3kste Indeed, good point! I also don't see how hatching on quadmeshes is a reasonable visualization.

    I would just remove this again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions