【发布时间】:2023-01-20 16:31:55
【问题描述】:
我有两个使用 matplotlib 生成的图。第一个代表我的背景,第二个代表我想展示的一组要点。有没有办法重叠这两个地块?
背景:
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize = (10,10))
grid_duomo = gpd.read_file('/content/Griglia_2m-SS.shp')
grid_duomo.to_crs(epsg=32632).plot(ax=ax, color='lightgrey')
要点:
fig = plt.figure(figsize=(10, 10))
ids = traj_collection_df_new_app['id'].unique()
for id_ in ids:
self_id = traj_collection_df_new_app[traj_collection_df_new_app['id'] == id_]
plt.plot(
self_id['lon'],
self_id['lat'],
# markers= 'o',
# markersize=12
)
【问题讨论】:
-
如果您只是删除对
plt.figure的调用,并一次运行这两个部分,matplotlib 通常会很好地组合它们。
标签: matplotlib