Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Cartopy: latitude axis gridlines disappear when stand_lon is changed in namelist.wps

Đang mở
#132 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
data-visualization

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện workflow vẽ Python Cartopy được mô tả trong issue, sử dụng đầu ra của WRF geogrid.exe và namelist.wps với các giá trị stand_lon khác nhau. So sánh nhãn của các đường lưới vĩ độ với các nhãn kinh độ và xác định việc bị cắt xảy ra trong wrf-python hay trong dependency vẽ; hoàn thành khi các nhãn vĩ độ vẫn hiển thị với các thiết lập phép chiếu đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi!

I was unsure whether to share this on the Cartopy Github page, but because the issue occurs due to a change related to WPS, it seemed appropriate to bring it up here.

I am using Cartopy 0.18.0 to plot out my WRF domains on a map. My process is running geogrid.exe and then executing a Python script that calls Cartopy to create the basemap.

In namelist.wps, I have been toying with the stand_lon variable - I would like it to deviate largely from ref_lon. However, when I set the value to be far enough away from ref_lon, run geogrid.exe, then try to plot the basemap with domain boxes overlaid, the latitude axis labels disappear! I want to have a much higher stand_lon so that my domains exclude higher-level terrain (the Rockies).

I use matplotlib.ticker.FixedLocator (Matplotlib 3.3.2) to add specific y-axis labels, but the issue seems to occur regardless of what tick method I choose. This is a specific issue for the y-axis only, as the longitudes on the x-axis seem fine. I did a test to see the extent of the problem by plotting a bunch of latitudes - and there seems to be a cutoff where Cartopy stops adding axis labels. Strange!

Initial figure: stand_lon = -123.5 = ref_lon
my_domain_1

Final figure: stand_lon = -88.5, ref_lon = -123.5
my_domain_2

Below are some lines of code connected to this problem.
Thanks so much for your help!

  • Anthony

` import cartopy.crs as ccrs
from cartopy.feature import BORDERS, COASTLINE, COLORS, LAKES, NaturalEarthFeature
from matplotlib.ticker import FixedLocator, MultipleLocator
import numpy as np

states = NaturalEarthFeature(category='cultural', scale='50m', name='admin_1_states_provinces_shp', facecolor='none')
ax.add_feature(states, edgecolor='k', linewidth=0.3)
ax.add_feature(COASTLINE, edgecolor='k', linewidth=0.5)
ax.add_feature(LAKES, edgecolor='k', facecolor='none', linewidth=0.5)
ax.add_feature(BORDERS, edgecolor='k', linewidth=0.5)

minlon = int(5*np.ceil(lons[(0,0)]/5))
maxlon = int(5*np.ceil(lons[(0,-1)]/5))
minlat = int(4*np.floor(lats[(0,0)]/4))
maxlat = int(4*np.ceil(lats[(-1,0)]/4))
lonticks = range(minlon,maxlon+1,5)
latticks = range(minlat,maxlat+1,4)

glnolabs = ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=False, linewidth=1.5, linestyle='--')
glnolabs.xlocator = MultipleLocator(base=5)
glnolabs.ylocator = MultipleLocator(base=5)

gl = ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=True, linewidth=1.5, linestyle='--')
gl.top_labels = False
gl.right_labels = False
gl.x_inline = False
gl.y_inline = False
gl.xlocator = FixedLocator(lonticks)
gl.ylocator = FixedLocator([40,41,42,43,44,45,46,47,48,49,50,51,52])

gl.xlabel_style = {'size':lblsz,  'color':'black',  'rotation':0}
gl.ylabel_style = {'size':lblsz,  'color':'black',  'rotation':0}

`

Ngôn ngữ chính
Python
Star
498
Fork
178
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NCAR/wrf-python

Tất cả issue của NCAR/wrf-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.