Matplotlib for Python Developers
eBook - ePub

Matplotlib for Python Developers

Aldrin Yim, Claire Chung, Allen Yu

Share book
  1. 300 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Matplotlib for Python Developers

Aldrin Yim, Claire Chung, Allen Yu

Book details
Book preview
Table of contents
Citations

About This Book

Leverage the power of Matplotlib to visualize and understand your data more effectivelyAbout This Book• Perform effective data visualization with Matplotlib and get actionable insights from your data• Design attractive graphs, charts, and 2D plots, and deploy them to the web• Get the most out of Matplotlib in this practical guide with updated code and examplesWho This Book Is ForThis book is essentially for anyone who wants to create intuitive data visualizations using the Matplotlib library. If you're a data scientist or analyst and wish to create attractive visualizations using Python, you'll find this book useful. Some knowledge of Python programming is all you need to get started.What You Will Learn• Create 2D and 3D static plots such as bar charts, heat maps, and scatter plots• Get acquainted with GTK+3, Qt5, and wxWidgets to understand the UI backend of Matplotlib• Develop advanced static plots with third-party packages such as Pandas, GeoPandas, and Seaborn• Create interactive plots with real-time updates• Develop web-based, Matplotlib-powered graph visualizations with third-party packages such as Django• Write data visualization code that is readily expandable on the cloud platformIn DetailPython is a general-purpose programming language increasingly being used for data analysis and visualization. Matplotlib is a popular data visualization package in Python used to design effective plots and graphs. This is a practical, hands-on resource to help you visualize data with Python using the Matplotlib library.Matplotlib for Python Developers, Second Edition shows you how to create attractive graphs, charts, and plots using Matplotlib. You will also get a quick introduction to third-party packages, Seaborn, Pandas, Basemap, and Geopandas, and learn how to use them with Matplotlib. After that, you'll embed and customize your plots in third-party tools such as GTK+3, Qt 5, and wxWidgets. You'll also be able to tweak the look and feel of your visualization with the help of practical examples provided in this book. Further on, you'll explore Matplotlib 2.1.x on the web, from a cloud-based platform using third-party packages such as Django. Finally, you will integrate interactive, real-time visualization techniques into your current workflow with the help of practical real-world examples.By the end of this book, you'll be thoroughly comfortable with using the popular Python data visualization library Matplotlib 2.1.x and leveraging its power to build attractive, insightful, and powerful visualizations.Style and approachStep by step approach to learning the best of Matplotlib 2.1.x

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Matplotlib for Python Developers an online PDF/ePUB?
Yes, you can access Matplotlib for Python Developers by Aldrin Yim, Claire Chung, Allen Yu in PDF and/or ePUB format, as well as other popular books in Informatik & Datenvisualisierung. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781788628136
Edition
2

Embedding Matplotlib in GTK+3

We have worked on quite a few examples so far, and now have a good foundation from which to use Matplotlib to generate data plots and figures. While using Matplotlib alone is very handy in generating interactive figures, experimenting with datasets, and understanding substructures of data, there may be instances where we want an application to acquire, parse, and display our data.
In this chapter, we will study examples on how to embed Matplotlib in applications through GTK+3.

Installing and setting up GTK+3

Setting up GTK+3 is fairly simple and straightforward. There are quite a few ways to install GTK+3 depending on your OS version and environment.
We encourage our readers refer to the link: https://python-gtk-3-tutorial.readthedocs.io/en/latest/install.html for the latest updates and information on installation.
At the time of writing this book, the official website advises users to install GTK+3 through JHBuild. However, users have experienced a compatibility issue with JHBuild with the macOS El Capitan.
We recommend macOS users to use the package manager brew to install GTK+3.
GTK+3 can be installed simply if you have brew installed in your macOS:
#Installing the gtk3 package brew install gtk3 #Installing PyGObject brew install pygobject3
For Linux systems such as Ubuntu, GTK+3 is installed by default. For sophisticated and advanced users who prefer a more customized approach to installing GTK+3, we encourage referring their website to obtain the most recently updated information.
We have observed that GTK+3 visualization is not as compatible with IPython Notebook. We encourage you to run the code on the Terminal for best results.

A brief introduction to GTK+3

Before exploring the various examples and applications, let's first acquire a brief, high-level understanding of the GTK+3.
GTK+3 contains a set of graphical control elements (widgets) and is a highly usable, feature-rich toolkit used to develop graphical user interfaces. It has cross-platform compatibility and is relatively easy to use. GTK+3 is an object-oriented widget toolkit written in the C programming language. Therefore, when running GTK+3 in Python, we need a wrapper to call the functions in the GTK+3 library. In this case, PyGObject is a Python module that serves as the wrapper and saves us time by not having to learn two languages to plot our figures. PyGObject exclusively supports GTK+3 or later versions. If you prefer to use GTK+2 in your application, we recommend using PyGTK instead.
Toget...

Table of contents