Solve the TypeError no numeric data to plot in Pandas

In today’s tutorial we’ll learn how to troubleshoot a common plotting error that you might encounter when working in Pandas and trying to plot your data during its pre processing for data analysis. Reproducing the problem In order to reproduce the error, we will first construct a very simple DataFrame. Your Python development environment (Jupyter, … Read more

How to add a legend in a Matplotlib chart?

In today’s hands on data visualization tutorial we’ll learn how to insert a legend into an existing chart. Rendering a Matplotlib chart We’ll use Python and the Matplotlib library to draw a simple line chart. In our example we would like to show the revenue from B2B vs B2C sales of an imaginary company during … Read more

How to save a chart figure in Matplotlib and Seaborn?

In today’s data visualization tutorial we’ll learn how to save a Matplotlib plot as a graphic file so you can later on embed into a website, presentation, Excel spreadsheet or documents. Creating our Matplotlib chart We’ll first go ahead and create our plot using Python and Matplotlib. Note that we’ll also use Numpy to generate … Read more

How to plot multiple lines with Python, Seaborn, Pandas and Matplotlib?

Today we’ll learn to draw a bit more sophisticated lineplots that display multiple lines. We’ll provide examples leveraging the two popular Python Data Visualization libraries: Seaborn and Matplotlib. Importing Data Visualization libraries Create example data We’ll use numpy to quickly generate simple x,y coordinate data. Seaborn multiple lines chart We will start by using Seaborn … Read more

How to create a Scatter plot in Pandas with Python?

In this Data Visualization tutorial we’ll learn how to quickly render and customize custom charts using Python and the Pandas library. It’s important to note that the Pandas plotting capabilities are a subset from those available in Matplotlib, a powerful Data Visualization library, which we have covered in other tutorials. Python scatter plots example – … Read more