Skip to content

Control lon and lat gridline label color independently #362

@zxdawn

Description

@zxdawn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions