Title: Apply gtk3 background. by anntzer · Pull Request #10298 · matplotlib/matplotlib · GitHub
Open Graph Title: Apply gtk3 background. by anntzer · Pull Request #10298 · matplotlib/matplotlib
X Title: Apply gtk3 background. by anntzer · Pull Request #10298 · matplotlib/matplotlib
Description: Currently, gtk3 widget backgrounds are not being applied (which only matters if the figure patch is partially transparent). The lines added by this PR are equivalent to the call to painter.eraseRect(self.rect()) in the qt5agg backend (compare http://doc.qt.io/qt-5/qpainter.html#eraseRect and https://developer.gnome.org/gtk3/stable/GtkStyleContext.html#gtk-render-background). As an example, run import os; os.environ["MPLBACKEND"] = "gtk3cairo" from pylab import * from gi.repository import Gtk rcParams["figure.facecolor"] = (0, 0, 0, 0) css = Gtk.CssProvider() css.load_from_data(b"* {background-color: red;}") gcf().canvas.get_style_context().add_provider( css, Gtk.STYLE_PROVIDER_PRIORITY_USER) gca() show() Without this patch, the red background is not drawn. (gtk3agg behaves in the same way after #10297 is applied). PR Summary PR Checklist Has Pytest style unit tests Code is PEP 8 compliant New features are documented, with examples if plot related Documentation is sphinx and numpydoc compliant Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way
Open Graph Description: Currently, gtk3 widget backgrounds are not being applied (which only matters if the figure patch is partially transparent). The lines added by this PR are equivalent to the call to painter.eraseRe...
X Description: Currently, gtk3 widget backgrounds are not being applied (which only matters if the figure patch is partially transparent). The lines added by this PR are equivalent to the call to painter.eraseRe...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/10298
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9370cd0d-897f-8da3-37a8-1a9687483c19 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | ACCE:26FC3D:205450:2B51F3:6A527238 |
| html-safe-nonce | a2f0e6a8ea63a030543ad20f1092b76df85d1cd0b8a8e54db8e9e0ddfddd7aaf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0NFOjI2RkMzRDoyMDU0NTA6MkI1MUYzOjZBNTI3MjM4IiwidmlzaXRvcl9pZCI6Ijg1MzE1MDMyMTI5ODkxNDk3NTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0362a91734fc7b6fe7e86f8c3bbd412a8dd35dd236b2e2442c0b4220a8143e81 |
| hovercard-subject-tag | pull_request:164473659 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/10298/files |
| twitter:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| og:image:alt | Currently, gtk3 widget backgrounds are not being applied (which only matters if the figure patch is partially transparent). The lines added by this PR are equivalent to the call to painter.eraseRe... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width