Giter VIP home page Giter VIP logo

Comments (3)

tcassou avatar tcassou commented on July 28, 2024

Hi @slayomer, thanks for asking!

  1. The scatter method (as well as other plot methods) expect pandas.Series objects as arguments for both latitudes and longitudes (you can see this in the docstring). When accessing the ith element with df_geo['latitude'][i], what you get is a float 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 the iloc method (so df_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!

  2. 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.

omerfarukeker avatar omerfarukeker commented on July 28, 2024

Hi @tcassou thanks for your swift response, it worked well.

Also managed to solve the other issues which are:

  1. 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.
  2. 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.

tcassou avatar tcassou commented on July 28, 2024

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)

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.