question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong grid line labels with Lambert projection

See original GitHub issue

Description

Now, the newest cartopy (0.18.0) supports adding grid line labels to the Lambert projection.

But, the labels shown by proplot are wrong.

I suppose proplot misses some keys:

x_inline=False, y_inline=False

Steps to reproduce

import proplot as plot
f, axs = plot.subplots(proj='lcc')
axs.format(coast=True,
           latlines=1, lonlines=1,
           labels=True,
           lonlim=(113, 119),
           latlim=(37, 41.5))

Expected behavior: proj_cartopy

Actual behavior:

proj

Equivalent steps in matplotlib

import matplotlib.pyplot as plt
import cartopy.crs as crs

proj = crs.LambertConformal(central_latitude = 38.854,
                            central_longitude = 115.643,
                            standard_parallels = (30, 60),
                            false_easting = 64.,
                            false_northing = 67.)


axs = plt.axes(projection=proj)
axs.coastlines()
axs.set_extent([113, 119, 37, 41.5], crs=crs.PlateCarree())
gl = axs.gridlines(draw_labels=True, dms=True, x_inline=False, y_inline=False)
gl.top_labels = gl.right_labels = False

Proplot version

master branch

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
lukelbdcommented, May 13, 2020

Thanks, I’ll add support for “inline” keywords before the next release. I think I’ll also add rc keywords, something like rc['geogrid.loninline'] and rc['geogrid.latinline'], and maybe will make the default “inline” setting to False because I don’t like how the “inline” labels look in the proplot examples and your first example looks much nicer to me.

0reactions
zxdawncommented, May 24, 2020

@lukelbd Thanks! cartopy_share

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make Cartopy gridline labels show with Lambert ...
I know plotting grid labels with Lambert Conformal projection is a new feature in Cartopy, so I wasn't sure if this is just...
Read more >
Adding gridline labels to a cartopy Lambert Conformal ...
Adding gridline labels to a cartopy Lambert Conformal projection plot ... to be rectangular, return the line corresponding to a given side of...
Read more >
Cartopy map gridlines and tick labels - SciTools
Enter search terms or a module, class or function name. Cartopy map gridlines and tick labels¶. The Gridliner instance, often created ...
Read more >
Lambert Conformal Native Grid Projections - NCL Graphics
Describes techniques for plotting data on lambert conformal native grid projections. ... pmTickMarkDisplayMode = "Always" turns on nicer tickmark labels.
Read more >
How to Properly Rotate WRF Winds to Earth-Relative ...
In the case of a Mercator projection, the model grid does align with earth ... vr, color='green',label='Unrotated - wrong') # rotate winds to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found