在matplotlib中缩放球形投影

在matplotlib中缩放球形投影,matplotlib,map-projections,Matplotlib,Map Projections,我需要展示一个投影在天空中的星系目录。并非所有的天空都与此相关,因此我需要在相关部分居中缩放。我大致同意任何投影,如Lambert、Mollweide等。以下是使用Mollweide的模拟数据和代码示例: # Generating mock data np.random.seed(1234) (RA,Dec)=(np.random.rand(100)*60 for _ in range(2)) # Creating projection projection='mollweide' fig =

我需要展示一个投影在天空中的星系目录。并非所有的天空都与此相关,因此我需要在相关部分居中缩放。我大致同意任何投影,如Lambert、Mollweide等。以下是使用Mollweide的模拟数据和代码示例:

# Generating mock data
np.random.seed(1234)
(RA,Dec)=(np.random.rand(100)*60 for _ in range(2))

# Creating projection
projection='mollweide'
fig = plt.figure(figsize=(20, 10));
ax = fig.add_subplot(111, projection=projection);

ax.scatter(np.radians(RA),np.radians(Dec)); 

# Creating axes
xtick_labels = ["$150^{\circ}$", "$120^{\circ}$", "$90^{\circ}$", "$60^{\circ}$", "$30^{\circ}$", "$0^{\circ}$", 
                "$330^{\circ}$", "$300^{\circ}$", "$270^{\circ}$", "$240^{\circ}$", "$210^{\circ}$"]
labels = ax.set_xticklabels(xtick_labels, fontsize=15);     
ytick_labels = ["$-75^{\circ}$", "$-60^{\circ}$", "$-45^{\circ}$", "$-30^{\circ}$", "$-15^{\circ}$", 
                "$0^{\circ}$","$15^{\circ}$", "$30^{\circ}$", "$45^{\circ}$", "$60^{\circ}$", 
                "$75^{\circ}$", "$90^{\circ}$"]

ax.set_yticklabels(ytick_labels,fontsize=15);     
ax.set_xlabel("RA");
ax.xaxis.label.set_fontsize(20);
ax.set_ylabel("Dec");
ax.yaxis.label.set_fontsize(20);
ax.grid(True);
结果如下:

我尝试了各种
set_whateverlim
set_extent
clip_box
等等,以及导入cartopy并传递
ccrs.lambertcomular(中心经度=…,中心纬度=…)
作为参数。我无法得到结果

此外,我想将RA记号标签向下移动,因为它们很难用真实数据读取。不幸的是,
ax.tick_参数(pad=-5)
没有任何作用