You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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. backend_cairo.set_antialias("default", text="best") to mean "antialias=True means ANTIALIAS_DEFAULT, except for texts which use ANTIALIAS_BEST" (texts go through a separate path for antialiasing so it is reasonable to provide a separate configuration knob specifically for them). This seems simpler than forcing all artists to carry detailed antialiasing state which only matters for some backends; also note that while not impossible, the use case of wanting some artists to use ANTIALIAS_FAST and others to use ANTIALIAS_BEST seems rare.
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.
Activity
github-actions commentedon Apr 13, 2023
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!
anntzer commentedon Apr 13, 2023
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.
backend_cairo.set_antialias("default", text="best")to mean "antialias=True means ANTIALIAS_DEFAULT, except for texts which use ANTIALIAS_BEST" (texts go through a separate path for antialiasing so it is reasonable to provide a separate configuration knob specifically for them). This seems simpler than forcing all artists to carry detailed antialiasing state which only matters for some backends; also note that while not impossible, the use case of wanting some artists to use ANTIALIAS_FAST and others to use ANTIALIAS_BEST seems rare.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.