From c7a25441bfa016efb888238240e327e86dd225d2 Mon Sep 17 00:00:00 2001 From: Jacques Kvam Date: Wed, 31 May 2017 10:34:00 -0700 Subject: [PATCH] crude map function --- plotlywrapper.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/plotlywrapper.py b/plotlywrapper.py index 3d4c58f..778e313 100644 --- a/plotlywrapper.py +++ b/plotlywrapper.py @@ -958,6 +958,41 @@ def hist2d(x, y, label=None, opacity=None): return Chart(data=data) +def scattergeo(latitude, longitude, size=1, text=None, location='USA-states'): + """TODO: Docstring for map. + + Parameters + ---------- + locations : TODO + type : TODO, optional + locationmode : TODO, optional + + Returns + ------- + TODO + + """ + data = go.Scattergeo( + locationmode=location, + lon=longitude, + lat=latitude, + text=text, + mode='markers', + marker=dict( + size=size, + line=dict(width=1) + ) + ) + layout = dict( + geo=dict( + scope='usa', + projection=dict(type='albers usa'), + showland=True + ) + ) + return Chart(data=[data], layout=layout) + + class PandasPlotting(object): """ These plotting tools can be accessed through dataframe instance