Title: Context Menu for snapping view to primary axis planes in 3D plots by AdwaithBatchu · Pull Request #30976 · matplotlib/matplotlib · GitHub
Open Graph Title: Context Menu for snapping view to primary axis planes in 3D plots by AdwaithBatchu · Pull Request #30976 · matplotlib/matplotlib
X Title: Context Menu for snapping view to primary axis planes in 3D plots by AdwaithBatchu · Pull Request #30976 · matplotlib/matplotlib
Description: PR summary closes #23544 This PR introduces a feature that adds context menu on 3d Axes triggered by right-click of the mouse. Added context_menu() in Figure Manager that takes arguments, a list of labels and a list of corresponding functions to execute upon selection. Modified _button_release() to call canvas.manager.context_menu() with functions for setting orthographic views when the right-click is released on the mouse without moving it significantly. Mouse movement is handled in _on_move() using a small threshold because previously I observed trackpad (on macOS) reported micro-movements during a static click, which falsely flagged the action as "drag" and blocked the menu in specific backends. Backends TkAgg: tk.Menu implementation. QtAgg: QtWidgets.QMenu implementation. WxAgg: Uses wx.Menu and PopupMenu. Gtk3Agg: Uses Gtk.Menu. Gtk4Agg: Uses Gtk.PopoverMenu and Gio.Menu. MacOSX: Yet to be implemented WebAgg: Yet to be implemented NbAgg: Yet to be implemented import matplotlib # matplotlib.use("TkAgg") # Change to QtAgg, GTK4Agg, MacOSX, WxAgg, etc. import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(projection="3d") ax.plot([0, 1, 2], [0, 1, 0], [0, 1, 0]) plt.show() PR checklist "closes #0000" is in the body of the PR description to link the related issue new and changed code is tested Plotting related features are demonstrated in an example New Features and API Changes are noted with a directive and release note Documentation complies with general and docstring guidelines
Open Graph Description: PR summary closes #23544 This PR introduces a feature that adds context menu on 3d Axes triggered by right-click of the mouse. Added context_menu() in Figure Manager that takes arguments, a list...
X Description: PR summary closes #23544 This PR introduces a feature that adds context menu on 3d Axes triggered by right-click of the mouse. Added context_menu() in Figure Manager that takes arguments, a list...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/30976
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b4f202ed-553d-c536-a959-7bbf5925a867 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DF40:20B327:2636BA0:32F7A76:6A520F25 |
| html-safe-nonce | 3c98487d57150bee6b069416438d9a57f424ba2bd9f1b699c3e72279c0ac7e33 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjQwOjIwQjMyNzoyNjM2QkEwOjMyRjdBNzY6NkE1MjBGMjUiLCJ2aXNpdG9yX2lkIjoiODI4NzIyOTIyMzIzNTc4NjYxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0c0a9036cfd1c97dba580a9d342a107687c72c971dfec30e3199dec5036c3169 |
| hovercard-subject-tag | pull_request:3181652798 |
| 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/30976/files |
| twitter:image | https://avatars.githubusercontent.com/u/173444643?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/173444643?s=400&v=4 |
| og:image:alt | PR summary closes #23544 This PR introduces a feature that adds context menu on 3d Axes triggered by right-click of the mouse. Added context_menu() in Figure Manager that takes arguments, a list... |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width