Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Matplotlib 3.0 Cookbook
Matplotlib 3.0 Cookbook

Matplotlib 3.0 Cookbook: Over 150 recipes to create highly detailed interactive visualizations using Python

eBook
$35.98 $39.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Matplotlib 3.0 Cookbook

Getting Started with Basic Plots

In this chapter, we will cover recipes for plotting the following graphs:

  • Line plot
  • Bar plot
  • Scatter plot
  • Bubble plot
  • Stacked plot
  • Pie plot
  • Table chart
  • Polar plot
  • Histogram
  • Box plot
  • Violin plot
  • Heatmap
  • Hinton diagram
  • Images
  • Contour plot
  • Triangulations
  • Stream plot
  • Path

Introduction

A picture is worth a thousand words, and the visualization of data plays a critical role in finding hidden patterns in the data. Over a period of time, a variety of graphs have been developed to represent different relationships between different types of variables. In this chapter, we will see how to use these different graphs in different contexts and how to plot them using Matplotlib.

Line plot

The line plot is used to represent a relationship between two continuous variables. It is typically used to represent the trend of a variable over time, such as GDP growth rate, inflation, interest rates, and stock prices over quarters and years. All the graphs we have seen in Chapter 1, Anatomy of Matplotlib are examples of a line plot.

Getting ready

We will use the Google Stock Price data for plotting time series line plot. We have the data (date and daily closing price, separated by commas) in a .csv file without a header, so we will use the pandas library to read it and pass it on to the matplotlib.pyplot function to plot the graph.

Let's now import required libraries with the following code:

import matplotlib...

Bar plot

Bar plots are the graphs that use bars to compare different categories of data. Bars can be shown vertically or horizontally, based on which axis is used for a categorical variable. Let's assume that we have data on the number of ice creams sold every month in an ice cream parlor over a period of one year. We can visualize this using a bar plot.

Getting ready

We will use the Python calendar package to map numeric months (1 to 12) to the corresponding descriptive months (January to December).

Before we plot the graph, we need to import the necessary packages:

import matplotlib.pyplot as plt
import numpy as np
import calendar
...

Scatter plot

A scatter plot is used to compare distribution of two variables and see whether there is any correlation between them. If there are distinct clusters/segments within the data, it will be clear in the scatter plot.

Getting ready

Import the following libraries:

import matplotlib.pyplot as plt
import pandas as pd

We will use pandas to read the Excel files.

How to do it...

The following code block draws a scatter plot that depicts the relationship between the age and the weight of people:

  1. Set the figure size (width and height) to (10, 6) inches:
plt.figure(figsize...

Bubble plot

A bubble plot is drawn using the same plt.scatter() method. It is a manifestation of the scatter plot, where each point on the graph is shown as a bubble. Each of these bubbles can be displayed with a different color, size, and appearance.

Getting ready

Import the required libraries. We will use pandas to read the Excel file:

import matplotlib.pyplot as plt
import pandas as pd

How to do it...

The following code block plots a bubble plot, for which we have seen a scatter plot earlier:

  1. Load the Iris dataset:
iris = pd.read_csv('iris_dataset.csv',...

Stacked plot

A stacked plot represents the area under the line plot, and multiple line plots are stacked one over the other. It is used to provide a visualization of the cumulative effect of multiple variables being plotted on the y axis.

We will plot the number of product defects by a defect reason code, for three months stacked together to give a cumulative picture for the quarter.

Getting ready

Import the required libraries:

import numpy as np
import matplotlib.pyplot as plt

How to do it...

The following are the steps to plot a stacked plot:

  1. Define the data for the...

Pie plot

A pie plot is used to represent the contribution of various categories/groups to the total. For example, the contribution of each state to the national GDP, contribution of a movie to the total number of movies released in a year, student grades (A, B, C, D, and E) as a percentage of the total class size, or a distribution of monthly household expenditure on groceries, vegetables, utilities, apparel, education, healthcare, and so on.

Getting ready

Import the required library:

import matplotlib.pyplot as plt

How to do it...

The following code block plots a pie...

Table chart

A table chart is a combination of a bar chart and a table, representing the same data. So, it is a combination of pictorial representation along with the corresponding data in a table.

Getting ready

We will consider an example of the number of batteries sold in each year, with different ampere hour (Ah) ratings. There are two categorical variables: year and Ah ratings, and one numeric variable: the number of batteries sold.

Import the required libraries:

import numpy as np
import matplotlib.pyplot as plt

How to do it...

The following code block draws a table...

Polar plot

The polar plot is a chart plotted on the polar axis, which has coordinates as angle (in degrees) and radius, as opposed to the Cartesian system of x and y coordinates. We will take the example of planned versus the actual expense incurred by various departments in an organization. This is also known as a spider web plot.

Getting ready

Import the required libraries:

import numpy as np
import matplotlib.pyplot as plt

How to do it...

Since it is a circular spider web, we need to connect the last point to the first point, so that there is a circular flow of the...

Histogram

The histogram plot is used to draw the distribution of a continuous variable. Continuous variable values are split into the required number of bins and plotted on the x axis, and the count of values that fall in each of the bins is plotted on the y axis. On the y axis, instead of count, we can also plot percentage of total, in which case it represents probability distribution. This plot is typically used in statistical analysis.

Getting ready

We will use the example of data on prior work experience of participants in a lateral training program. Experience is measured in number of years.

Import the required libraries:

import matplotlib.pyplot as plt
import numpy as np
...

Box plot

The box plot is used to visualize the descriptive statistics of a continuous variable. It visually shows the first and third quartile, median (mean), and whiskers at 1.5 times the Inter Quartile Range (IQR)—the difference between the third and first quartiles, above which are outliers. The first quartile (the bottom of rectangular box) marks a point below which 25% of the total points fall. The third quartile (the top of rectangular box) marks a point below which 75% of the points fall.

If there are no outliers, then whiskers will show min and max values.

This is again used in statistical analysis.

Getting ready

We will use an example of wine quality dataset for this example. We will consider three attributes...

Violin plot

The violin plot is a combination of histogram and box plot. It gives information on the complete distribution of data, along with mean/median, min, and max values.

Getting ready

We will use the same data that we used for the box plot for this example also.

Import the required libraries:

import matplotlib.pyplot as plt
import pandas as pd

How to do it...

The following is the code block that draws violin plots:

  1. Read the data from a CSV file into a pandas DataFrame:
wine_quality = pd.read_csv('winequality.csv', delimiter=';')

  1. Prepare the...

Reading and displaying images

Matplotlib.pyplot has features that enable us to read .jpeg and .png images and covert them to pixel format to display as images.

Getting ready

Import the required library:

 import matplotlib.pyplot as plt

How to do it...

Here is the code block that reads a JPEG file as a pixel-valued list and displays it as an image on the screen:

  1. Read the image louvre.jpg into a three-dimensional array (color images have three channels, whereas black and white images have one channel only):
image = plt.imread('louvre.jpg')
  1. Print the dimensions...

Heatmap

A heatmap is used to visualize data range in different colors with varying intensity. Here, we take the example of plotting a correlation matrix as a heatmap. Elements of the correlation matrix indicate the strength of a linear relationship between the two variables, and the matrix contains such values for all combinations of the attributes in the given data. If the data has five attributes, then the correlation matrix will be a 5 x 5 matrix.

Getting ready

We will use the Wine Quality dataset for this example also. It has 12 different attributes. We will first get a correlation matrix and then plot it as a heatmap. There is no heatmap function/method as such, so we will use the same imshow method that we used to read...

Hinton diagram

The Hinton diagram is a 2D plot for visualizing weight matrices in deep-learning applications. Matplotlib does not have a direct method to plot this diagram. So, we will have to write code to plot this. The weight matrix for this is taken from one of the machine learning algorithms that classifies images.

Getting ready

Import the required libraries:

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

How to do it...

The following code block defines the function and makes a call to the function to plot the Hinton diagram:

  1. Read the weight...

Contour plot

The contour plot is typically used to display how the error varies with varying coefficients that are being optimized in a machine learning algorithm, such as linear regression. If the linear regression coefficients are theta0 and theta1, and the error between the predicted value and the actual value is a Loss, then for a given Loss value, all the values of theta0 and theta1 form a contour. For different values of Loss, different contours are formed by varying the values of theta0 and theta1.

Getting ready

The data for Loss, theta0, theta1, and theta (optimal values of theta0 and theta1 that give the lowest error) are taken from one of the regression problems for plotting the contour plot. If theta0 and theta1...

Triangulations

Triangulations are used to plot geographical maps, which help with understanding the relative distance between various points. The longitude and latitude values are used as x, y coordinates to plot the points. To draw a triangle, three points are required; these are specified with the corresponding indices of the points on the plot. For a given set of coordinates, Matplotlib can compute triangles automatically and plot the graph, or optionally we can also provide triangles as an argument.

Getting ready

Import the required libraries. We will introduce the tri package for triangulations:

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.tri as tri
...

Stream plot

Stream plots, also known as streamline plots are used to visualize vector fields. They are mostly used in the engineering and scientific communities. They use vectors and their velocities as a function of base vectors to draw these plots.

Getting ready

Import the required libraries:

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec

How to do it...

The following code block creates a stream plot:

  1. Prepare the data for the stream plot:
x, y = np.linspace(-3,3,100), np.linspace(-2,4,50)
  1. Create the mesh grid:
X, Y = np.meshgrid...

Path

Path is a method provided by Matplotlib for drawing custom charts. It uses a helper function patch that is provided by Matplotlib. Let's see how this can be used to draw a simple plot.

Getting ready

Import the required libraries. Two new packages, Path and patches, will be introduced here:

import matplotlib.pyplot as plt
from matplotlib.path import Path
import matplotlib.patches as patches

How to do it...

The following code block defines points and associated lines and curves to be drawn to form the overall picture:

  1. Define the points along with the first curve...
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Master 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

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.

Who is this book 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.

What you will learn

  • Develop 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 Matplotlib
Estimated delivery fee Deliver to Argentina

Standard delivery 10 - 13 business days

$12.95

Premium delivery 3 - 6 business days

$40.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 23, 2018
Length: 676 pages
Edition : 1st
Language : English
ISBN-13 : 9781789135718
Category :
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Argentina

Standard delivery 10 - 13 business days

$12.95

Premium delivery 3 - 6 business days

$40.95
(Includes tracking information)

Product Details

Publication date : Oct 23, 2018
Length: 676 pages
Edition : 1st
Language : English
ISBN-13 : 9781789135718
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 125.97
Matplotlib 3.0 Cookbook
$48.99
Mastering Matplotlib 2.x
$32.99
Matplotlib for Python Developers
$43.99
Total $ 125.97 Stars icon

Table of Contents

16 Chapters
Anatomy of Matplotlib Chevron down icon Chevron up icon
Getting Started with Basic Plots Chevron down icon Chevron up icon
Plotting Multiple Charts, Subplots, and Figures Chevron down icon Chevron up icon
Developing Visualizations for Publishing Quality Chevron down icon Chevron up icon
Plotting with Object-Oriented API Chevron down icon Chevron up icon
Plotting with Advanced Features Chevron down icon Chevron up icon
Embedding Text and Expressions Chevron down icon Chevron up icon
Saving the Figure in Different Formats Chevron down icon Chevron up icon
Developing Interactive Plots Chevron down icon Chevron up icon
Embedding Plots in a Graphical User Interface Chevron down icon Chevron up icon
Plotting 3D Graphs Using the mplot3d Toolkit Chevron down icon Chevron up icon
Using the axisartist Toolkit Chevron down icon Chevron up icon
Using the axes_grid1 Toolkit Chevron down icon Chevron up icon
Plotting Geographical Maps Using Cartopy Toolkit Chevron down icon Chevron up icon
Exploratory Data Analysis Using the Seaborn Toolkit Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
(5 Ratings)
5 star 20%
4 star 20%
3 star 20%
2 star 20%
1 star 20%
John C. May 20, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is a well written and thorough survey of the Matplotlib library with a solid introduction to the Seaborn library. You don't need to know anything about Matplotlib to get started. It starts with plotting a line through two points on default axes and adds more and more features to the examples as the book progresses.That said, you DO need a basic competency in Python to understand the explanations. This is, after all, a library of extensions to the Python language.Super helpful is full code for all the examples available for download. You can read the discussion, experiment with the example code and really understand what's going on. You'll need the free open source Jupyter Python IDE to run the code, but Jupyter is probably the most frequently used platform for running Matplotlib, and it's ideal for this kind of hands on learning.
Amazon Verified review Amazon
Saurabh Oct 02, 2019
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Matplotlib is tedious but you need to know it whether you are using pandas based plotting or seaborn.I like the fact that book is very detailed. I don't know of a better book right now to learn matplotlib. However, the approach uses a lot of state based plotting, which is no longer recommended. For example it uses a lot of plt.xticks() instead of ax.xticks() approach.Another problem is it does not show how to make plots using pandas data frame plot method. Since most people making plots today are using pandas, I'm disappointed that the data frame plot method was not covered.Overall this book is not for beginner python users. It will be appreciated more by intermediate python and pandas users.
Amazon Verified review Amazon
Student of the Universe Oct 23, 2022
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
I've not a seasoned Python developer, so, when I purchased this book, I was pleased to see it has all the content I was interested in learning. I downloaded the code for this book from GitHub, worked through the first two chapters, and then in chapter 3, I ran into multiple errors right off. It appears that the book is out of date and the GitHub site is not updated for the latest Python 3 that is installed with Anaconda (I'm using the Mac). So, there is a chart where the author called out what is required for Windows 10. I will have to use Parallels on the Mac to see if that works. Pitty.
Amazon Verified review Amazon
Richard McClellan May 15, 2019
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
It is a pretty good book. The code examples are clear, and well explained.HOWEVER. This is 2019. You buy a programming book (I bought the Kindle version) you expect to be able to access the code. Usually on-line or a download. Since you can't cut and past out of Kindle, typing in examples is wholly last century.Well, there is a website (packt) that supposedly lets you download. 95mb zipped file later, I find that it is some combination of pdf's and png's of output. No code. Some mysterious IPYNB extension. So--a last century level, effectively. Last century you got a CD.It would be at least 4 stars if I could get at the code without having to type it all in.Two stars because it isn't entirely worthless.
Amazon Verified review Amazon
Adrian Savage Apr 12, 2019
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
This is, as it says, a cookbook. That is it give recipes for many different uses for Matplotlib. What it fails to do is to give any useful information as to the Matplotlib modules, the uses to which they can be put and the syntax of each command. In fact, should you wish to find out how a call such as Matplotlib.dates.DateFormatter works, you will not even find it in the index. In fact date and time are not in the index so in the 652 mostly useless pages of the book, you will struggle to make a graph with date/time on the x axis. As a cookbook its recipes are without taste or interest.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela