Title: Inconsistent behavior of markevery between semilogx and semilogy plots · Issue #8356 · matplotlib/matplotlib · GitHub
Open Graph Title: Inconsistent behavior of markevery between semilogx and semilogy plots · Issue #8356 · matplotlib/matplotlib
X Title: Inconsistent behavior of markevery between semilogx and semilogy plots · Issue #8356 · matplotlib/matplotlib
Description: Bug report The markevery option for plot, semilogx, semilogy, and loglog plotting methods has a weird difference of behavior between plot / semilogy and semilogx / loglog, when using markevery = (float, float). Code for reproduction impo...
Open Graph Description: Bug report The markevery option for plot, semilogx, semilogy, and loglog plotting methods has a weird difference of behavior between plot / semilogy and semilogx / loglog, when using markevery = (f...
X Description: Bug report The markevery option for plot, semilogx, semilogy, and loglog plotting methods has a weird difference of behavior between plot / semilogy and semilogx / loglog, when using markevery = (f...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/8356
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistent behavior of markevery between semilogx and semilogy plots","articleBody":"### Bug report\r\n- The `markevery` option for `plot`, `semilogx`, `semilogy`, and `loglog` plotting methods has a weird difference of behavior between `plot / semilogy` and `semilogx / loglog`, when using `markevery = (float, float)`.\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n# Generate some data\r\nX = np.linspace(-10, 10, 1000)\r\nY = np.sin(X)**2\r\n\r\n# Specify markers\r\nmarkers = ['o', 'v', '^', '\u003c', '\u003e']\r\n\r\ndef markevery(i):\r\n # I tried a *lot* of values here, none were working for the 4 plots\r\n return (i / 50., 0.1)\r\n\r\nplt.figure()\r\n\r\n# First plot in normal plot\r\nplt.subplot(221)\r\nfor i in range(10):\r\n plt.plot(X, Y + i / 10., marker=markers[i % len(markers)], markevery=markevery(i), label=str(i))\r\nplt.legend()\r\nplt.title(\"plt.plot(): markers are here!\")\r\n\r\n# Then plot in semilogx\r\nplt.subplot(222)\r\nfor i in range(10):\r\n plt.semilogx(X, Y + i / 10., marker=markers[i % len(markers)], markevery=markevery(i), label=str(i))\r\nplt.legend()\r\nplt.title(\"plt.semilogx(): markers are NOT here!\")\r\n\r\n# And then semilogy\r\nplt.subplot(223)\r\nfor i in range(10):\r\n plt.semilogy(X, Y + i / 10., marker=markers[i % len(markers)], markevery=markevery(i), label=str(i))\r\nplt.legend()\r\nplt.title(\"plt.semilogy(): markers are here!\")\r\n\r\n# Finally plot in loglog\r\nplt.subplot(224)\r\nfor i in range(10):\r\n plt.loglog(X, Y + i / 10., marker=markers[i % len(markers)], markevery=markevery(i), label=str(i))\r\nplt.legend()\r\nplt.title(\"plt.loglog(): markers are NOT here!\")\r\n\r\nplt.suptitle(\"Weird behavior of markevery between plt.plot, plt.semilogx, plt.semilogy, plt.loglog\")\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\n- One would expect the markers to be located in a **similar fashion** for each of the four plots method, `plot`, `semilogx`, `semilogy`, and `loglog`. The two plots on the left have markers correctly located (well spacen, with a different starting point for the different curves), and the two plots on the right do not show markers.\r\n- Note that I tried a lot of different values for the `markevery` parameters (here `markevery = (i / 50., 0.1)` for the various curves, with changing `i` to change the starting point of the markers), and always encounter this inconsistency between left and right.\r\n\r\n**Matplotlib version**\r\n\r\n- Matplotlib version 2.0.0 (`2.0.0+3337.gc15694b`), with Python 3.5, on Ubuntu 16.10\r\n- Python installed with apt, latest version of Matplotlib installed with `pip --upgrade`.\r\n\r\n----\r\n\r\nMaybe I don't understand the [semantic behind using `markevery = (float, float)`](http://matplotlib.org/api/lines_api.html#matplotlib.lines.Line2D.set_markevery), but as far as I can tell, this behavior is weird.\r\nThanks in advance!\r\n","author":{"url":"https://github.com/Naereen","@type":"Person","name":"Naereen"},"datePublished":"2017-03-21T14:55:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":25},"url":"https://github.com/8356/matplotlib/issues/8356"}
| 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:282ac3c4-ade7-cda6-1a57-e8e2c4174500 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 963A:1AF501:13956A:19C8D9:6A5162C8 |
| html-safe-nonce | 56dd8f510e44479eb8bbc65ac22b8714890f7279fe8d68e7ad34e59571391a90 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjNBOjFBRjUwMToxMzk1NkE6MTlDOEQ5OjZBNTE2MkM4IiwidmlzaXRvcl9pZCI6IjEyMDgwOTE4MjU4OTE1MzM1MTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6beba786e694e0f7ea9e69269bbe3a106a40a8f0b1f1de6356270e05d58584a8 |
| hovercard-subject-tag | issue:215767889 |
| 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/8356/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ce66e75fcda11873beb0abe7c6a10a4989f1ce4a60142a396b90515ec9b80f6d/matplotlib/matplotlib/issues/8356 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ce66e75fcda11873beb0abe7c6a10a4989f1ce4a60142a396b90515ec9b80f6d/matplotlib/matplotlib/issues/8356 |
| og:image:alt | Bug report The markevery option for plot, semilogx, semilogy, and loglog plotting methods has a weird difference of behavior between plot / semilogy and semilogx / loglog, when using markevery = (f... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Naereen |
| 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 | 2eeb434949a926fad21064b4d395a54759f7a0b2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width