首页 > 解决方案 > 如何使用 mplleaflet 绘制热图?

问题描述

我收到错误:get_offset_position 函数在 Matplotlib 3.3 中已被弃用,并将在两个次要版本中删除。

offset_order = offset_dict[collection.get_offset_position()

plog_fig_interp,ax = plt.subplots(figsize=(12,9)) 
ax.scatter(df['Lon'],df['Lat'],c=df['co2'],cmap='jet') 
mplleaflet.show(fig=plog_fig_interp)

数据如下所示:

                     Lat        Lon         co2
Date
2019-07-19 08:00:00  48.161853  11.543937  726.305667
2019-07-19 08:00:03  48.161870  11.543932  733.974500
2019-07-19 08:00:06  48.161862  11.543938  727.221000
2019-07-19 08:00:09  48.161862  11.543938  704.938500
2019-07-19 08:00:12  48.161862  11.543938  690.199667
...                        ...        ...         ...
2019-07-19 17:29:45  48.148785  11.572585  550.429667
2019-07-19 17:29:48  48.148768  11.572583  545.866667
2019-07-19 17:29:51  48.148768  11.572583  544.453000
2019-07-19 17:29:54  48.148767  11.572572  544.697000
2019-07-19 17:29:57  48.148773  11.572568  547.018000

[11400 rows x 3 columns]

标签: python

解决方案


推荐阅读