Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如果要在一页多图里面使用cnmaps,只有最后一张图用了cnmaps #28

Closed
zhaolanxiai opened this issue Apr 24, 2022 · 4 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@zhaolanxiai
Copy link

No description provided.

@Clarmy
Copy link
Member

Clarmy commented Apr 24, 2022

可以提供一下代码片段吗?如果有数据就更好了。

@hepengz
Copy link

hepengz commented May 13, 2022

像下面这样,只有ax2中能绘制,能否传递ax?
from cnmaps import get_adm_maps, draw_maps
import matplotlib.pyplot as plt
import cartopy.crs as ccrs

def plot_map(ax):
draw_maps(get_adm_maps(province='河南省'), linewidth=0.3, color='k')
return ax

cart_proj = ccrs.PlateCarree()
fig = plt.figure(figsize=(5, 5), dpi=300)

ax1 = fig.add_axes([0.13, 0.15, 0.5, 0.5], projection=cart_proj)
ax2 = fig.add_axes([0.13+0.65, 0.15, 0.5, 0.5], projection=cart_proj)

ax1 = plot_map(ax1)
ax2 = plot_map(ax2)

@hepengz
Copy link

hepengz commented May 13, 2022

from cnmaps import get_adm_maps, draw_maps
import matplotlib.pyplot as plt
import cartopy.crs as ccrs

cart_proj = ccrs.PlateCarree()
fig = plt.figure(figsize=(5, 5), dpi=300)

ax1 = fig.add_axes([0.13, 0.15, 0.5, 0.5], projection=cart_proj)
draw_maps(get_adm_maps(province='河南省'), linewidth=0.3, color='k')

ax2 = fig.add_axes([0.13+0.65, 0.15, 0.5, 0.5], projection=cart_proj)
draw_maps(get_adm_maps(province='河南省'), linewidth=0.3, color='k')

@Clarmy Clarmy self-assigned this Jul 6, 2022
@Clarmy Clarmy added the bug Something isn't working label Jul 6, 2022
@Clarmy Clarmy added wontfix This will not be worked on and removed bug Something isn't working labels Aug 3, 2022
@Clarmy
Copy link
Member

Clarmy commented Aug 3, 2022

调整一下绘制顺序:

from cnmaps import get_adm_maps, draw_maps
import matplotlib.pyplot as plt
import cartopy.crs as ccrs

def plot_map(ax):
    draw_maps(get_adm_maps(province='河南省'), linewidth=0.3, color='k')
    return ax

cart_proj = ccrs.PlateCarree()
fig = plt.figure(figsize=(5, 5), dpi=300)

ax1 = fig.add_axes([0.13, 0.15, 0.5, 0.5], projection=cart_proj)
ax1 = plot_map(ax1)

ax2 = fig.add_axes([0.13+0.65, 0.15, 0.5, 0.5], projection=cart_proj)
ax2 = plot_map(ax2)

image

@Clarmy Clarmy mentioned this issue Oct 3, 2022
@Clarmy Clarmy closed this as completed Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants