Coder Social home page Coder Social logo

Comments (4)

Clarmy avatar Clarmy commented on June 8, 2024

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

from cnmaps.

hepengz avatar hepengz commented on June 8, 2024

像下面这样,只有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)

from cnmaps.

hepengz avatar hepengz commented on June 8, 2024

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')

from cnmaps.

Clarmy avatar Clarmy commented on June 8, 2024

调整一下绘制顺序:

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

from cnmaps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.