Title: [Bug]: MultiCursor in inset axes · Issue #26225 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: MultiCursor in inset axes · Issue #26225 · matplotlib/matplotlib
X Title: [Bug]: MultiCursor in inset axes · Issue #26225 · matplotlib/matplotlib
Description: Bug summary When we using a MultiCursor on an axes and an inset axis, the cursor follow the mouse only on the main axes. When the mouse cursor move on the inset axes the cursor don't move. Code for reproduction import numpy as np import ...
Open Graph Description: Bug summary When we using a MultiCursor on an axes and an inset axis, the cursor follow the mouse only on the main axes. When the mouse cursor move on the inset axes the cursor don't move. Code for...
X Description: Bug summary When we using a MultiCursor on an axes and an inset axis, the cursor follow the mouse only on the main axes. When the mouse cursor move on the inset axes the cursor don't move. Code...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/26225
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: MultiCursor in inset axes","articleBody":"### Bug summary\n\nWhen we using a MultiCursor on an axes and an inset axis, the cursor follow the mouse only on the main axes. When the mouse cursor move on the inset axes the cursor don't move.\n\n### Code for reproduction\n\n```python\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom matplotlib.widgets import MultiCursor\r\n\r\n# Fixing random state for reproducibility\r\nnp.random.seed(19680801)\r\n\r\n# some random data\r\nx = np.random.randn(1000)\r\ny = np.random.randn(1000)\r\n\r\n\r\ndef scatter_hist(x, y, ax, ax_histx, ax_histy):\r\n # no labels\r\n ax_histx.tick_params(axis=\"x\", labelbottom=False)\r\n ax_histy.tick_params(axis=\"y\", labelleft=False)\r\n\r\n # the scatter plot:\r\n ax.scatter(x, y)\r\n\r\n # now determine nice limits by hand:\r\n binwidth = 0.25\r\n xymax = max(np.max(np.abs(x)), np.max(np.abs(y)))\r\n lim = (int(xymax/binwidth) + 1) * binwidth\r\n\r\n bins = np.arange(-lim, lim + binwidth, binwidth)\r\n ax_histx.hist(x, bins=bins, label=\"X\")\r\n ax_histy.hist(y, bins=bins, orientation='horizontal', label=\"Y\")\r\n \r\n# Create a Figure, which doesn't have to be square.\r\nfig = plt.figure(layout='constrained')\r\n# Create the main axes, leaving 25% of the figure space at the top and on the\r\n# right to position marginals.\r\nax = fig.add_gridspec().subplots()\r\n# The main axes' aspect can be fixed.\r\n\r\n#ax.set(aspect=1)\r\n# Create marginal axes, which have 25% of the size of the main axes. Note that\r\n# the inset axes are positioned *outside* (on the right and the top) of the\r\n# main axes, by specifying axes coordinates greater than 1. Axes coordinates\r\n# less than 0 would likewise specify positions on the left and the bottom of\r\n# the main axes.\r\nax_histx = ax.inset_axes([0, -0.25, 1, 0.12], sharex=ax)\r\nax_histy = ax.inset_axes([-0.25, 0, 0.12, 1], sharey=ax)\r\nax_plus = ax.inset_axes([1.05, 0, 0.02, 1])\r\n# Draw the scatter plot and marginals.\r\nscatter_hist(x, y, ax, ax_histx, ax_histy)\r\n\r\n\r\nmulti1 = MultiCursor(None, (ax, ax_histx), useblit=False, horizOn=False, vertOn=True, color='r', lw=1)\r\nmulti2 = MultiCursor(None, (ax_histy, ax), useblit=False, horizOn=True, vertOn=False, color='r', lw=1)\r\n\r\n#ax.set_aspect(0.5)\r\n\r\nplt.show()\n```\n\n\n### Actual outcome\n\n\r\nhttps://github.com/matplotlib/matplotlib/assets/65216088/7fcdd145-8fbf-4903-96f4-64ad50f29a06\r\n\r\n\n\n### Expected outcome\n\nThe cursor move following mouse for all axis.\n\n### Additional information\n\n_No response_\n\n### Operating system\n\nUbuntu\n\n### Matplotlib Version\n\n3.1.6\n\n### Matplotlib Backend\n\nQtAgg\n\n### Python version\n\n 3.10.6\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\npip","author":{"url":"https://github.com/jlocatelli74","@type":"Person","name":"jlocatelli74"},"datePublished":"2023-06-30T14:48:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/26225/matplotlib/issues/26225"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:69bb29f5-966c-7350-7677-1cda33821d54 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A2F2:20874E:B9DF6B:F89C1F:6A52BDAF |
| html-safe-nonce | 7a0c96459232564aee003a4954d91773547bef3a9bc37db193bcf9756de2f86f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkYyOjIwODc0RTpCOURGNkI6Rjg5QzFGOjZBNTJCREFGIiwidmlzaXRvcl9pZCI6Ijg5NTAwNDMxMjAyMzk4MjAyMDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7fa48b98618ca4e3f8cea7b03b570490b915e319009d6ff18489bdb6f273fed3 |
| hovercard-subject-tag | issue:1782663464 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/matplotlib/matplotlib/26225/issue_layout |
| twitter:image | https://opengraph.githubassets.com/478e8fc3fc7138a2c8db0f030e0339d643936a3509f0529cea7f624f2e54f4d8/matplotlib/matplotlib/issues/26225 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/478e8fc3fc7138a2c8db0f030e0339d643936a3509f0529cea7f624f2e54f4d8/matplotlib/matplotlib/issues/26225 |
| og:image:alt | Bug summary When we using a MultiCursor on an axes and an inset axis, the cursor follow the mouse only on the main axes. When the mouse cursor move on the inset axes the cursor don't move. Code for... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jlocatelli74 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| 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