Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anntzer opened this issue Apr 7, 2025 · 2 comments Β· Fixed by #29905
Closed

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

anntzer opened this issue Apr 7, 2025 · 2 comments Β· Fixed by #29905
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Milestone

Comments

@anntzer
Copy link
Contributor

anntzer commented Apr 7, 2025

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

@anntzer anntzer added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Apr 7, 2025
@QuLogic QuLogic added this to the v3.11.0 milestone Apr 8, 2025
@r3kste
Copy link
Contributor

r3kste commented Apr 11, 2025

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

@timhoffm
Copy link
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
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants