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: patch-diff.githubusercontent.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:da00d2e4-33cf-7f09-4f3f-5b9f46c1fbbe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC60:2EA095:D78E4C:DA6331:697A7FAB |
| html-safe-nonce | d6c5343d82499c4fd817cc239961ea4415f389b87db783853a4ea10d2b2e9042 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzYwOjJFQTA5NTpENzhFNEM6REE2MzMxOjY5N0E3RkFCIiwidmlzaXRvcl9pZCI6IjQxOTkzNTk3NDUyMTI3MTA4MjciLCJyZWdpb25fZWRnZSI6InNlYSIsInJlZ2lvbl9yZW5kZXIiOiJzZWEifQ== |
| visitor-hmac | 42955a5a64bae1e48da34f89f9b9277ea6ce7b701617a16377a70f31954a9254 |
| 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 | f6192227ebb08ae3d66e887f7363efea6f1ba29abe280990e1f6ad2d2962b6c8 |
| 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 | 7f58967b50cdccb4b617fbacac94376e17eef59e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width