Below is a snippet of code from Brian Blaylock's True Color Recipe. I am
trying to instead display imagery in a Mercator projection. I thought I would
do this with a line such as:
mc=cartopy.ccrs.Mercator(central_longitude=0.0, min_latitude=-80.0,
max_latitude=84.0, globe=None)
and then have lines:
ax = fig.add_subplot(1, 1, 1, projection=mc)
ax.set_extent([-135, -60, 10, 65], crs=ccrs.Mercator())
but this does not work. Can someone point out what I am doing wrong or point me
to the correct resource so I might understand my problem better?
Thanks, Jim
------ Code snippet ---------
fig = plt.figure(figsize=(15, 12))
# Generate an Cartopy projection
lc = ccrs.LambertConformal(central_longitude=-97.5, standard_parallels=(38.5,
38.5))
ax = fig.add_subplot(1, 1, 1, projection=lc)
ax.set_extent([-135, -60, 10, 65], crs=ccrs.PlateCarree())
ax.imshow(RGB, origin='upper',
extent=(x.min(), x.max(), y.min(), y.max()),
transform=geos,
interpolation='none')
ax.coastlines(resolution='50m', color='black', linewidth=0.5)
ax.add_feature(ccrs.cartopy.feature.STATES, linewidth=0.5)
plt.title('GOES-16 True Color', loc='left', fontweight='bold', fontsize=15)
plt.title('{}'.format(scan_start.strftime('%d %B %Y %H:%M UTC ')), loc='right')
plt.show()
This message and its attachments may contain legally privileged or confidential
information. It is intended solely for the named addressee(s). If you are not
an addressee indicated in this message (or responsible for delivery of the
message to an addressee), you may not copy or deliver this message or its
attachments to anyone. Rather, you should permanently delete this message and
its attachments and kindly notify the sender by reply e-mail. Any content of
this message and its attachments that does not relate to the official business
of Fox Corporation, or its subsidiaries must be taken not to have been sent or
endorsed by any of them. No representation is made that this email or its
attachments are without defect.