Title: Secondary axis does not show minor ticks. · Issue #14443 · matplotlib/matplotlib · GitHub
Open Graph Title: Secondary axis does not show minor ticks. · Issue #14443 · matplotlib/matplotlib
X Title: Secondary axis does not show minor ticks. · Issue #14443 · matplotlib/matplotlib
Description: Bug report Bug summary Matplotlib 3.1 introduced a new method for adding a secondary axes with Axes.axes.secondary_xaxis and Axes.axes.secondary_xaxis. However, the .minorticks_on() method does nothing on those axes. Code for reproductio...
Open Graph Description: Bug report Bug summary Matplotlib 3.1 introduced a new method for adding a secondary axes with Axes.axes.secondary_xaxis and Axes.axes.secondary_xaxis. However, the .minorticks_on() method does not...
X Description: Bug report Bug summary Matplotlib 3.1 introduced a new method for adding a secondary axes with Axes.axes.secondary_xaxis and Axes.axes.secondary_xaxis. However, the .minorticks_on() method does not...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/14443
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Secondary axis does not show minor ticks.","articleBody":"\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nMatplotlib 3.1 introduced a new method for adding a secondary axes with `Axes.axes.secondary_xaxis` and `Axes.axes.secondary_xaxis`. However, the `.minorticks_on()` method does nothing on those axes.\r\n\r\n**Code for reproduction**\r\n\r\nI use the example provided in the gallery -- https://matplotlib.org/3.1.0/gallery/subplots_axes_and_figures/secondary_axis.html -- but modify it to show minor ticks.\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nfig, ax = plt.subplots(constrained_layout=True)\r\nx = np.arange(0, 360, 1)\r\ny = np.sin(2 * x * np.pi / 180)\r\nax.plot(x, y)\r\nax.set_xlabel('angle [degrees]')\r\nax.set_ylabel('signal')\r\nax.set_title('Sine wave')\r\n\r\ndef deg2rad(x):\r\n return x * np.pi / 180\r\n\r\ndef rad2deg(x):\r\n return x * 180 / np.pi\r\n\r\nsecax = ax.secondary_xaxis('top', functions=(deg2rad, rad2deg))\r\nsecax.set_xlabel('angle [rad]')\r\n\r\nax.minorticks_on()\r\nsecax.minorticks_on()\r\n\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\nThe top axis is expected to have minor ticks.\r\n\r\n**Matplotlib version**\r\n * Operating system: Linux 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u2 (2019-05-13) x86_64 GNU/Linux\r\n * Matplotlib version: 3.1.0 (conda default channel)\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): TkAgg\r\n * Python version: Python 3.6.8 |Anaconda custom (64-bit)|\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/Knusper","@type":"Person","name":"Knusper"},"datePublished":"2019-06-04T17:24:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/14443/matplotlib/issues/14443"}
| 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:4106a532-9e01-f573-24b4-a97c1a81792c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E4A6:3CF55C:1692E:1C752:6A5254EC |
| html-safe-nonce | a188dffef2ae045e216aaf95f5036d507f895660391933ee0ea42136ec1b1b9b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNEE2OjNDRjU1QzoxNjkyRToxQzc1Mjo2QTUyNTRFQyIsInZpc2l0b3JfaWQiOiI2Mjg1NTQ5MjQ5MjI1NzA4NzgwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0cd6983fb05f5c4906d6304140c8324310b0d5ab3b43ba2e0a744746e7a023cb |
| hovercard-subject-tag | issue:452116422 |
| 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/14443/issue_layout |
| twitter:image | https://opengraph.githubassets.com/41360b14c767fda6f5f2064d98d9f9cd9c6eea6c24dca68c46797c9505bf351b/matplotlib/matplotlib/issues/14443 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/41360b14c767fda6f5f2064d98d9f9cd9c6eea6c24dca68c46797c9505bf351b/matplotlib/matplotlib/issues/14443 |
| og:image:alt | Bug report Bug summary Matplotlib 3.1 introduced a new method for adding a secondary axes with Axes.axes.secondary_xaxis and Axes.axes.secondary_xaxis. However, the .minorticks_on() method does not... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Knusper |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width