Title: Show grid ticks on geographic plots · Issue #227 · proplot-dev/proplot · GitHub
Open Graph Title: Show grid ticks on geographic plots · Issue #227 · proplot-dev/proplot
X Title: Show grid ticks on geographic plots · Issue #227 · proplot-dev/proplot
Description: Description Currently, only grid_lines is supported for geographic plots. It would be useful to add the grid_ticks for cleaner plot. Steps to reproduce import proplot as plot fig, axs = plot.subplots(proj='cyl') axs.format(land=True, lab...
Open Graph Description: Description Currently, only grid_lines is supported for geographic plots. It would be useful to add the grid_ticks for cleaner plot. Steps to reproduce import proplot as plot fig, axs = plot.subplo...
X Description: Description Currently, only grid_lines is supported for geographic plots. It would be useful to add the grid_ticks for cleaner plot. Steps to reproduce import proplot as plot fig, axs = plot.subplo...
Opengraph URL: https://github.com/proplot-dev/proplot/issues/227
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Show grid ticks on geographic plots","articleBody":"### Description\r\n\r\nCurrently, only `grid_lines` is supported for geographic plots.\r\nIt would be useful to add the `grid_ticks` for cleaner plot.\r\n\r\n### Steps to reproduce\r\n\r\n```python\r\nimport proplot as plot\r\n\r\nfig, axs = plot.subplots(proj='cyl')\r\naxs.format(land=True,\r\n labels=True,\r\n lonlines=20,\r\n latlines=20,\r\n gridminor=True,\r\n lonlim=(-140, 60),\r\n latlim=(-10, 50))\r\n```\r\n\r\n**Expected behavior**: [What you expected to happen]\r\n\r\nTicks without gridlines.\r\n\r\nI found one example showing ticks with Gridlines:\r\n```\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.ticker as mticker\r\nimport cartopy.crs as ccrs\r\nfrom cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter\r\n\r\ndlon, dlat = 60, 30\r\nxticks = np.arange(0, 360.1, dlon)\r\nyticks = np.arange(-90, 90.1, dlat)\r\n\r\nfig = plt.figure(figsize=(6,5))\r\nax = fig.add_subplot(1,1,1, projection=ccrs.PlateCarree(central_longitude=180))\r\nax.coastlines() #海岸线\r\n\r\ngl = ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=False,linewidth=1, linestyle=':', color='k', alpha=0.8)\r\ngl.xlocator = mticker.FixedLocator(xticks)\r\ngl.ylocator = mticker.FixedLocator(yticks)\r\n\r\nax.set_xticks(xticks, crs=ccrs.PlateCarree())\r\nax.set_yticks(yticks, crs=ccrs.PlateCarree())\r\n\r\nax.xaxis.set_major_formatter(LongitudeFormatter(zero_direction_label=True))\r\nax.yaxis.set_major_formatter(LatitudeFormatter())\r\n```\r\n\r\n\r\n**Actual behavior**: [What actually happened]\r\nCan't let ticks show.\r\n\r\n\r\n\r\n\r\n### Proplot version\r\n\r\n`0.6.4`\r\n","author":{"url":"https://github.com/zxdawn","@type":"Person","name":"zxdawn"},"datePublished":"2020-09-26T11:19:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/227/proplot/issues/227"}
| 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:eefc8f65-3b15-e0f8-f46d-4de29d91972b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB1A:1663C8:6A19D5:8B165A:696B7383 |
| html-safe-nonce | d4dc4b349e093d15b1ebadef05c2ed99b786ae5449f8e2881ffd9dede4f95be2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjFBOjE2NjNDODo2QTE5RDU6OEIxNjVBOjY5NkI3MzgzIiwidmlzaXRvcl9pZCI6IjcwMzQ4MDg1MzE2NzU3MzkwMTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3598590eaadc315f52e13d5480d8ea177df572b7af78f24ec5c2b34a842aa2cc |
| hovercard-subject-tag | issue:709519550 |
| 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/proplot-dev/proplot/227/issue_layout |
| twitter:image | https://opengraph.githubassets.com/043a630b6bce6adaeb671fd3db279a03e75205ffc73f4fd9cbdd43feaff346d2/proplot-dev/proplot/issues/227 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/043a630b6bce6adaeb671fd3db279a03e75205ffc73f4fd9cbdd43feaff346d2/proplot-dev/proplot/issues/227 |
| og:image:alt | Description Currently, only grid_lines is supported for geographic plots. It would be useful to add the grid_ticks for cleaner plot. Steps to reproduce import proplot as plot fig, axs = plot.subplo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zxdawn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/proplot-dev/proplot git https://github.com/proplot-dev/proplot.git |
| octolytics-dimension-user_id | 108025793 |
| octolytics-dimension-user_login | proplot-dev |
| octolytics-dimension-repository_id | 113293661 |
| octolytics-dimension-repository_nwo | proplot-dev/proplot |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 113293661 |
| octolytics-dimension-repository_network_root_nwo | proplot-dev/proplot |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width