proplot icon indicating copy to clipboard operation
proplot copied to clipboard

Control lon and lat gridline label color independently

Open zxdawn opened this issue 2 years ago • 0 comments

Description

Sometimes, users may want to set different colors for lat and lon gridline labels. However, gridlabelcolor will change both.

Steps to reproduce

import proplot as pplt

fig, axs = pplt.subplots(proj='npstere')

axs.format(coast=True, boundinglat=60, latlines=10, facecolor='Gray',
           gridcolor='w', gridlabelcolor='b',
           gridlinewidth=2, gridlinestyle='--', latinline=True, lonlabels=True,
           )

image

Expected behavior: [What you expected to happen]

The longitude gridlabel is black and the latitude one is white.

Actual behavior:

Both are same color.

Equivalent steps in matplotlib

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

ax = plt.subplot(projection=ccrs.NorthPolarStereo())
ax.set_extent([-180,180,90,60], ccrs.PlateCarree())
ax.coastlines()
gl = ax.gridlines(draw_labels=True)
gl.xlabel_style = {'color': 'k'}
gl.ylabel_style = {'color': 'b'}

image

Proplot version

3.5.1
0.9.5.post202

zxdawn avatar Jun 03 '22 11:06 zxdawn