"Minor" longitude and latitude gridlines
See original GitHub issueIs there any straight forward way to stride through what tick labels are shown in cartopy? Or could this be added as a feature?
This would be the equivalent of having xticks=[0,5,10,15,20]
+ xticklabels=['0', '', '10', '', '20']
for instance. The idea here is especially in longitude when labels get packed and overlapped at a reasonable font size for folks to see.
import numpy as np
import proplot as plot
plot.rc['geogrid.linestyle'] = ':'
plot.rc['geogrid.linewidth'] = 2
plot.rc['geogrid.color'] = '#d3d3d3'
data = np.random.rand(90, 180)
lon = np.linspace(-179.5, 179.5, 180)
lat = np.linspace(-89.5, 89.5, 90)
f, ax = plot.subplots(width='12cm', aspect=4, proj='cyl', tight=True,)
p = ax.pcolormesh(lon, lat, data, )
ax.format(latlim=(20,50), lonlim=(-135, -105), land=True,
latlines=plot.arange(20,50,5), lonlines=plot.arange(-135,-105, 5),
labels=True)
ax.colorbar(p, loc='r')
This case doesn’t have any issues, but imagine if you wanted the label size to be 14, 16, or 18 point font for a poster. All the lon labels overlap. Any way to show just 130W, 120W, 110W but maintain the grid structure? I figure there’s a means to do it with the formatter/ticker, but I can’t figure it out…
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Latitude, Longitude and Coordinate System Grids
Here's how you can remember latitude and longitude: Latitude lines run east-west and are parallel to each other. If you go north, latitude ......
Read more >latitude and longitude - Students | Homework Help
Commonly called a grid system, it is made up of two sets of lines that cross each other. One set—lines of latitude—runs in...
Read more >Graticules—ArcGIS Pro | Documentation
Gridlines are the lines crossing over the map that delineate degrees of latitude and longitude. By default, the gridline intervals are calculated based...
Read more >Graticules and Grids | Map-N-Hike
The latitude/longitude grid is based on a sphere and is familiar to most people. Lines of latitude go around the world parallel to...
Read more >Graticules
The Graticules grid option places grid lines at specific intervals of latitude and longitude (in degrees). Specify the interval for lines of latitude...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is now in the master branch. Cartographic gridline properties are now controlled with the
grid
andgridminor
rc categories (geogrid
has been deprecated – the name will be translated and a warning will be issued when you try to use it).Also, gridline location specs like
lonminorlines=X
andlonlines=X
are now fully interpreted byconstructor.Locator()
, and formatter specs are interpreted byconstructor.Formatter()
– this is done by linking them to dummy_LonAxis
and_LatAxis
axes that track the map extent in degrees longitude/latitude – there is no longer a need forlonstep
andlatstep
settings since the defaultMaxNLocator
chooses appropriate intervals given the zoom level, just like with ordinary Cartesian plots. #167 really cleaned things up a lot.Here’s an example from the website:
Oops I think I read your comment as if that was a hacky workaround with the current infrastructure.