Skip to main content

worldmap is to plot and color countries or specific regions in a country using offline approaches.

Project description

Worldmap

Python PyPI Version License Downloads Donate

This python package enables to color different countries in the world or the regions per country. For this package, the svg images from https://www.w3.org are utilized, processed and colored.

Contents

Installation

  • Install worldmap from PyPI (recommended). Worldmap is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows.
  • Distributed under the Apache 2.0 license.
pip install worldmap
  • Alternatively, install worldmap from the GitHub source:
git clone https://github.com/erdogant/worldmap.git
cd worldmap
python setup.py install

Quick Start

  • Import worldmap method
import worldmap as worldmap
  • Simple example to color the different regions in the Netherlands:
names   = ['zeeland','Overijssel', 'flevoland']
opacity = [0.1, 0.2, 0.6]
cmap    = ['#ff0000'] # Different red accents
out = worldmap.colormap(names,opacity=opacity, cmap='Set1', loadmap='netherlands', filename='nederlandMap.svg')

  • Simple example to color the worldmap:
#### Coloring of maps   
names   = ['Nederland']
opacity = [100]
out = worldmap.colormap(names, opacity=opacity, loadmap='world')

  • Retrieve citynames for abbrevations:
NL = worldmap.code2city('NL')
GB = worldmap.code2city('GB')
  • Retrieve citynames for abbrevations:
locA=worldmap.city2code('Netherlands')
locB=worldmap.city2code('Germany')
  • Retrieve names in map
countries_world = worldmap.getmapnames(loadmap='world')
region_NL = worldmap.getmapnames(loadmap='netherlands')
regions_BE = worldmap.getmapnames(loadmap='belgium')

Citation

Please cite worldmap in your publications if this is useful for your research. Here is an example BibTeX entry:

@misc{erdogant2019worldmap,
  title={worldmap},
  author={Erdogan Taskesen},
  year={2019},
  howpublished={\url{https://github.com/erdogant/worldmap}},
}

References:

Maintainers

Licence

Donation

  • This package is created and maintained in my free time. If this package is usefull, you can show your gratitude :) Thanks!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for worldmap, version 0.1.6
Filename, size File type Python version Upload date Hashes
Filename, size worldmap-0.1.6-py3-none-any.whl (17.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size worldmap-0.1.6.tar.gz (16.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page