Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Pandas
  • Seaborn
  • Matplotlib
  • Altair
  • Bokeh
  • Data Analysis
  • R
  • Machine Learning Math
  • Machin Learning
  • Deep Learning
  • Deep Learning Projects
  • NLP
  • Computer vision
  • Data science
  • Deep learning interview question
  • Machin Learning Interview question
Open In App
Next Article:
plotly.express.scatter_geo() function in Python
Next article icon

plotly.express.scatter_geo() function in Python

Last Updated : 17 Jul, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report

Plotly library of Python can be very useful for data visualization and understanding the data simply and easily. Plotly graph objects are a high-level interface to plotly which are easy to use.

plotly.express.scatter_geo() function

This function is used to plot geographical data onto the maps.

Syntax: plotly.express.scatter_geo(data_frame=None, lat=None, lon=None, locations=None, locationmode=None, color=None, text=None, hover_name=None, hover_data=None, custom_data=None, size=None, title=None, template=None, width=None, height=None)

Parameters:

data_frame: DataFrame or array-like or dict needs to be passed for column names.

lat: This parameter is used to position marks according to latitude on a map.

lon: This parameter is used to position marks according to longitude on a map.

locations: This parameter is interpreted according to locationmode and mapped to longitude/latitude.

locationmode: This parameter determines the set of locations used to match entries in locations to regions on the map.

color: This parameters assign color to marks.

size: This parameter is used to assign mark sizes. It is either a name of a column in data_frame, or a pandas Series or array_like object.

title: This parameter sets the title of the figure.

width: This parameter sets the width of the figure

height: This parameter sets the height of the figure.

Example 1:

Python3
import plotly.express as px   df = px.data.gapminder().query("year == 2007")  plot = px.scatter_geo(df, locations="iso_alpha") plot.show() 

Output:

Example 2: Using the size and color argument

Python3
import plotly.express as px   df = px.data.gapminder().query("year == 2007")  plot = px.scatter_geo(df, locations="iso_alpha",                       size="gdpPercap",                       color = "country") plot.show() 

Output:


Next Article
plotly.express.scatter_geo() function in Python

D

deepanshumehra1410
Improve
Article Tags :
  • Python
  • Python-Plotly
  • Python Plotly express-class
Practice Tags :
  • python

Similar Reads

    plotly.express.scatter() function in Python
    Plotly library of Python can be very useful for data visualization and understanding the data simply and easily. Plotly graph objects are a high-level interface to plotly which are easy to use. plotly.express.scatter() function This function is used to create the scatter plot and can be used with pa
    2 min read
    plotly.express.scatter_3d() function in Python
    Plotly library of Python can be very useful for data visualization and understanding the data simply and easily. Plotly graph objects are a high-level interface to plotly which are easy to use. plotly.express.scatter_3d() function This function is used to create a 3D scatter plot and can be used wit
    2 min read
    plotly.express.scatter_polar() function in Python
    Plotly library of Python can be very useful for data visualization and understanding the data simply and easily. Plotly graph objects are a high-level interface to plotly which are easy to use. plotly.express.scatter_polar() functionThis function is used to create a polar chart. A polar chart repres
    2 min read
    plotly.express.scatter_ternary() function in Python
    Plotly library of Python can be very useful for data visualization and understanding the data simply and easily. Plotly graph objects are a high-level interface to plotly which are easy to use. plotly.express.scatter_ternary() functionThis method is used to create a ternary plot. A ternary plot is u
    2 min read
    Matplotlib.axes.Axes.scatter() in Python
    Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute.
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences