Comments (3)
Hi @slayomer, thanks for asking!
-
The
scatter
method (as well as other plot methods) expectpandas.Series
objects as arguments for both latitudes and longitudes (you can see this in the docstring). When accessing the ith element withdf_geo['latitude'][i]
, what you get is afloat
instead, which causes the program to fail.
So in your case if you need to plot only 1 point on the map, you could for example use this instead:df_geo['latitude'][i:i+1]
, which is the sub series from ith (included) to (i+1)th (excluded) element. I would on top suggest to explicitly use theiloc
method (sodf_geo['latitude'].iloc[i:i+1]
) to avoid confusion.
On my end I'll think of ways to validate the input and print out more explicit error messages! -
In the current setup the figure is defined inside plotting methods, and the
show
method is called, causing the plot to be rendered.
If you have suggestion on how to add support for subplots while keeping compatibility with current use cases, happy to hear them!
from mapsplotlib.
Hi @tcassou thanks for your swift response, it worked well.
Also managed to solve the other issues which are:
- Commented out the line 79: plt.figure(figsize=(10, 10)) as it creates new figure each time scatter function of the mapsplot.py is invoked.
- Also zoom of the map wasn't working properly in the for loop (it was too wide), I changed it to 20 which worked well.
Thanks again creating such nice library for google maps plotting.
Cheers,
Omer
from mapsplotlib.
Hi @slayomer
Good to hear it worked out - and thanks for the nice words!
About subplots if you think of an elegant way of enabling this option through the package while keeping compatibility with the current API, feel free to send a pull request.
I'll close this issue for now, don't hesitate to reopen it if needed,
Thomas
from mapsplotlib.
Related Issues (17)
- AttributeError: module 'gmaps' has no attribute 'plot_markers' HOT 3
- how to know which color is which cluster? HOT 2
- Unusable Map Results HOT 3
- Heatmap returns error: UnicodeDecodeError: 'ascii' codec can't decode byte 0x89 in position 0: ordinal not in range(128) HOT 12
- HTTP firbidden error HOT 5
- Integrate with GeoPandas? HOT 1
- Image positioning and zooming HOT 2
- Heatmap colours are very dim HOT 2
- Polyline? HOT 3
- Allow passing API key without adding it to code (for install through pypi) HOT 1
- IOError: cannot identify image file <StringIO.StringIO instance HOT 6
- Filter out NaNs in lat/long
- Rotate map HOT 4
- Set upper limit in `get_zoom` function. HOT 3
- unable to import mapsplotlib HOT 5
- Zoom in and out HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapsplotlib.