Giter Site home page Giter Site logo

geo-joyplot's Introduction

Geography to JoyPlot

This is a little library (one function) to translate a lat-long box to a JoyPlot plot using the joypy library and the Google Elevation API.

Installation

git clone https://github.com/pblankley/geo-joyplot
cd geo-joyplot
python setup.py install

Example

After you install the library, you can use it as follows:

import joypy
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import geo_joyplot

GOOGLE_API = '<API-KEY>'
top_left = (38.9439, -106.3746)
bot_right = (38.8253, -106.1966)

# Get the plotting pandas dataframe
plot_df = geo_joyplot.get_plot_df(top_left, bot_right, api_key=GOOGLE_API, n_vert=50, n_horiz=100)

# Plot with the joypy library
fig,ax = plt.subplots(figsize=(10,8))
joypy.joyplot(plot_df, by='lat_o', column='lng', \
              xlabels=False, ylabels=False, \
              colormap=cm.gist_earth_r, linewidth=0.5, alpha=0.7,\
                fill=True, linecolor='#3d4447', ax=ax, overlap=2.5);
plt.show()

Running this should result in the following image of the Sawatch range near Leadville, CO!



Have fun, and open an issue if there are problems.

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.