Skip to main content

heatmapanimation

Python package for generating heatmap animation with given data and geojson.

English | 简体中文

Introduction

If you want to generate a heatmap animation with given data and geojson file or url, you can use this package. You can also type the region name or code replacing the geojson file.

Use 高德地图地理/逆地理编码 get the region code.

Use 阿里云数据可视化平台 get the geojson file.

Note: Currently, the region name must be in Chinese.

Install

pip install heatmapanimation

Usage

import heatmapanimation as hma

heatmap = hma.Heatmap() # create a heatmap object

# set the configuration
heatmap.region = '北京'
heatmap.datafile = './data/data.csv'
heatmap.run_x() # run the animation

API Reference

class heatmapanimation.Heatmap()

You must set a region and datafile before run the animation.
  • region

    The region name you want to generate the heatmap animation. Must be type Chinese region in Chinese.

  • region_code

    The region code you want to generate the heatmap animation. Must be type Chinese region code.

  • region_url

    The url of the geojson file.Or the geojson file path.

  • datafile

    The data file path.

  • data

    The data you want to generate the heatmap animation.

    Options: dict or list or json or pandas.DataFrame.

  • output_format

    The output format of the animation.

    Options: 'gif' or 'mp4'.

  • fig_name

    The name of the output file.

    Note: If you don't set the fig_name, the output file will be named as the region name.

  • color_map

    The colormap of the heatmap.

    Options: 'Blues', 'BuGn', 'BuPu', 'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd', 'PuBu'.

    All the colormaps are in matplotlib.

    Default: 'Reds'

  • isLegend

    Whether to show the legend.

    Options: True or False.

    Default: False.

  • legend_label

    The label of the legend.

    Options: str.

    Default: 'Temperature'.

  • legend_location

    The location of the legend.

    Options: 'right' or 'right'.

    Default: 'right'.

  • legend_min

    The min value of the legend.

    Options: int or float.

    Default: the minimum of the data.

  • legend_max

    The max value of the legend.

    Options: int or float.

    Default: the maximum of the data.

  • run_x()

    Run the animation and generate frame image and synthetic GIF. Currently, the output format is only 'gif'.

  • run()

    Run the animation with another method which can not show the legend. But the output format is gif, mp4, jshtml and html5.

License

MIT

Release files for heatmapanimation 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for heatmapanimation 0.0.6
File Size Uploaded
heatmapanimation-0.0.6.tar.gz 1.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for heatmapanimation 0.0.6
File Interpreter ABI Platform
heatmapanimation-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / heatmapanimation-0.0.6.tar.gz

Download URL heatmapanimation-0.0.6.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
c92290e002b0954328ff238af4e55bcdc9478d45921f1842b321ed2c3406632f
BLAKE2b-256 checksum
How to use checksums
196ace9707de236553c4d791e43badc4a1a0b16959591dc94cf4e7a6bd069472
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / heatmapanimation-0.0.6-py3-none-any.whl

Download URL heatmapanimation-0.0.6-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4bf4b687c23cc98c8822466fd6920d05300f2621cee748b007f8300bf8e378f5
BLAKE2b-256 checksum
How to use checksums
86f4d6d0eb16f29faf3653eba239d04eb059a906a229097f44f04d2f4f8db02f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page