-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Expose cairo antialiasing abilities #8784
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
Comments
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
This has been partially implemented in #19719, but it is still not possible to specifically pick detailed cairo antialias values ("default"/"none"/"gray"/etc.) I now think that extra degree of customization is better handled on backend_cairo's side by providing e.g. I'll make a PR for backend_cairo, with the idea of implementing the same API in mplcairo; I think it's still useful to have that in backend_cairo as an "official" example of how to configure this kind of extra abilities in third-party backends. Edit: I changed my mind; let's just close this. Indeed, the natural way to store this for the cairo backend would be in rcparams (after all there are already webagg-specific rcparams too), but it would be awkward if those didn't apply to mplcairo. However mplcairo currently uses more complex defaults (currently it defaults to ANTIALIAS_FAST except for very thin lines for which it uses ANTIALIAS_BEST, which is a choice I've made basically on aesthetical grounds) but I don't want to leak these details back into matplotlib itself... In any case, real-world demand for this seems nonexistent; we can always revisit as needed. |
Currently, the cairo backend does not support setting antialiasing:
This comment is no longer true; in fact many antialiasing modes have been supported for a while (and can be easily set):
https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-set-antialias
https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t
The issue is that True/False is not sufficient to describe the antialiasing modes. Should we, say, allow the user to pass in a string value ("default"/"none"/"gray"/etc.)? Passing a "native" cairo value won't work, as they are simply integers (and exposed as such by cairocffi, and as int subclasses by pycairo), and ANTIALIAS_DEFAULT=0 (which includes some antialiasing) and ANTIALIAS_NONE=1, which will conflict with the integer values of False=0, True=1.
The text was updated successfully, but these errors were encountered: