Matplotlib 3.0 Cookbook
Book information
Description
Build attractive, insightful, and powerful visualizations to gain quality insights from your data Key FeaturesMaster Matplotlib for data visualization Customize basic plots to make and deploy figures in cloud environments Explore recipes to design various data visualizations from simple bar charts to advanced 3D plots Book Description Matplotlib provides a large library of customizable plots, along with a comprehensive set of backends. Matplotlib 3.0 Cookbook is your hands-on guide to exploring the world of Matplotlib, and covers the most effective plotting packages for Python 3.7. With the help of this cookbook, you'll be able to tackle any problem you might come across while designing attractive, insightful data visualizations. With the help of over 150 recipes, you'll learn how to develop plots related to business intelligence, data science, and engineering disciplines with highly detailed visualizations. Once you've familiarized yourself with the fundamentals, you'll move on to developing professional dashboards with a wide variety of graphs and sophisticated grid layouts in 2D and 3D. You'll annotate and add rich text to the plots, enabling the creation of a business storyline. In addition to this, you'll learn how to save figures and animations in various formats for downstream deployment, followed by extending the functionality offered by various internal and third-party toolkits, such as axisartist, axes_grid, Cartopy, and Seaborn. By the end of this book, you'll be able to create high-quality customized plots and deploy them on the web and on supported GUI applications such as Tkinter, Qt 5, and wxPython by implementing real-world use cases and examples. What you will learnDevelop simple to advanced data visualizations in Matplotlib Use the pyplot API to quickly develop and deploy different plots Use object-oriented APIs for maximum flexibility with the customization of figures Develop interactive plots with animation and widgets Use maps for geographical plotting Enrich your visualizations using embedded texts and mathematical expressions Embed Matplotlib plots into other GUIs used for developing applications Use toolkits such as axisartist, axes_grid1, and cartopy to extend the base functionality of MatplotlibWho this book is for The Matplotlib 3.0 Cookbook is for you if you are a data analyst, data scientist, or Python developer looking for quick recipes for a multitude of visualizations. This book is also for those who want to build variations of interactive visualizations. Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you. 1: Anatomy of Matplotlib Introduction Working in interactive mode Working in non-interactive mode Reading from external files and plotting Changing and resetting default environment variables 2: Getting Started with Basic Plots Introduction Line plot Bar plot Scatter plot Bubble plot Stacked plot Pie plot Table chart Polar plot Histogram Box plot Violin plot Reading and displaying images Heatmap Hinton diagram Contour plot Triangulations Stream plot Path 3: Plotting Multiple Charts, Subplots, and Figures Introduction Plotting multiple graphs on the same axes Plotting subplots on the same figure Plotting multiple figures in a session Logarithmic scale Using units of measurement 4: Developing Visualizations for Publishing Quality Introduction Color, line style, and marker customization Working with standard colormaps User-defined colors and colormaps Working with legend Customizing labels and titles Using autoscale and axis limits Customizing ticks and ticklabels Customizing spines Twin axes Using hatch Using annotation Using style sheets 5: Plotting with Object-Oriented API Introduction Plotting a correlation matrix using pyplot and object-oriented APIs Plotting patches using object-oriented API Plotting collections using object-oriented API 6: Plotting with Advanced Features Using property cycler Using Path effects Using transforms Taking control of axes positions GridSpec for figure layout Using origin and extent for image orientation Geographical plotting using geopandas 7: Embedding Text and Expressions Introduction Using mathematical expressions with a font dictionary Annotating a point on a polar plot Using ConnectionPatch Using a text box Plotting area under an integral curve Defining custom markers Fractions, regular mathematical expressions, and symbols Word embeddings in two dimensions 8: Saving the Figure in Different Formats Introduction Saving the figure in various formats Avoiding truncation while saving the figure Saving partial figures Managing image resolution Managing transparency for web applications Creating multi-page PDF reports 9: Developing Interactive Plots Introduction Events and callbacks Widgets Animation 10: Embedding Plots in a Graphical User Interface Introduction Using the Slider and Button Widgets of Matplotlib Using the Slider and Button widgets of Tkinter GUI Embedding Matplotlib in a Tkinter GUI application Using the Slider and Button widgets of WxPython GUI Embedding Matplotlib in to a wxPython GUI application Using the Slider and Button widgets of Qt's GUI Embedding Matplotlib in to a Qt GUI application 11: Plotting 3D Graphs Using the mplot3d Toolkit Introduction Line plot Scatter plot Bar plot Polygon plot Contour plot Surface plot Wireframe plot Triangular surface plot Plotting 2D data in 3D 3D visualization of linearly non-separable data in 2D Word embeddings 12: Using the axisartist Toolkit Introduction Understanding attributes in axisartist Defining curvilinear grids in rectangular boxes Defining polar axes in rectangular boxes Using floating axes for a rectangular plot Creating polar axes using floating axes Plotting planetary system data on floating polar axes 13: Using the axes_grid1 Toolkit Introduction Plotting twin axes using the axisartist and axesgrid1 toolkits Using AxesDivider to plot a scatter plot and associated histograms Using AxesDivider to plot a colorbar Using ImageGrid to plot images with a colorbar in a grid Using inset_locator to zoom in on an image Using inset_locator to plot inset axes 14: Plotting Geographical Maps Using Cartopy Toolkit Introduction Plotting basic map features Plotting projections Using grid lines and labels Plotting locations on the map Plotting country maps with political boundaries Plotting country maps using GeoPandas and cartopy Plotting populated places of the world Plotting the top five and bottom five populated countries Plotting temperatures across the globe Plotting time zones Plotting an animated map 15: Exploratory Data Analysis Using the Seaborn Toolkit Introduction Relational plots Categorical plots Distribution plots Regression plots Multi-plot grids Matrix plots
Similar books
EXCEL 2023 CRASH COURSE: Master Excel 2023 With This Complete Crash Course In 7 Days
2022 · EPUB
The arraignment and tryall with a declaration of the Ranters also, several sentences proceedings at the sessions in the Old-Baily, and Councel of War: their protestations and the hanging of one up by the thumbs; with divers penalties to be inflicted upon others. The dancing and revelling of Dr. Buckeridge and his wife, and other gent. dancing all in white, in Berkshire, and their Christmas carol. A dispute between a Ranter in Bridewel, and one that came to see him; with his creed and pater noster: and the names of the false gods they worship. As also, a list of many of the Ranters, from whence they are derived: and of many hundreds of them in England
2019 · EPUB
The discoverer; vvherein is set forth (to undeceive the nation) the reall plots and stratagems of Lievt. Col. John Lilburn, Mr. William Walwyn, Mr. Thomas Prince, Mr. Richard Overton, and that partie ... Namely, under the pretence and colour of libertie ... a most dangerous and destructive designe is carried on to deprive the nation of their religion, rights, liberties, proprieties, lawes, government, &c. and to bring a totall and universall ruine upon the land. And so much is here clearely proved. The first part
2019 · EPUB
An act to impower Sir John Molesworth: Baronet, and Joseph Moyle, Esquire, Two of the surviving Trustees, in an Indenture, dated the Twenty-Fifth Day of December One thousand Seven hundred and Forty-Three, to raise the several Sums in the said Indenture mentioned, or such of them as are still unsatisfied, and pay the same, as well as the rest of the personal Estate of Hugh Gregor, deceased, to such Person as Jane Gregor, an Infant, shall marry during her Infancy, with the Consent of the surviving Trustees, and of her Guardians
EPUB
Case Histories
2008 · EPUB
Pandora's Seed: The Unforeseen Cost of Civilization
2010 · EPUB
Obama's Wars
2010 · EPUB
Trickle Up Poverty: Stopping Obama's Attack on Our Borders, Economy, and Security
2010 · EPUB