Python Data Visualization: Basics & Examples

Instructor: David Gloag

David has over 40 years of industry experience in software development and information technology and a bachelor of computer science

In this lesson, we will define Data Visualization and Python, go over the basics of Data Visualization in Python, and show some examples of how this is accomplished.

Reducing the Clutter

As a people, we look for themes or patterns in almost everything we encounter. We look for trends in the movement of the stock market, we try to see clear skies in the current weather trend, and we even imagine winning streaks for our favorite sports teams. We can't help it. It's part of who we are. But how do we find these themes or patterns? How do we reduce things down to that level, particularly in today's complex world? There's no easy answer. Each problem may require a different solution. But there are two things that can help with many of them, Data Visualization and Python.

What is Data Visualization?

Data Visualization converts information into visuals. And through our affinity for visuals, we can more quickly and easily understand the information being represented. For example, consider the high and low temperature values for your hometown over the last month. If you want to know the temperature trends, would they be easier to see with the raw information or with a graph of those values? For most of us, the answer is a graph. Why? Well, first of all, visuals are more appealing to most of us. And second, we find it easier to recognize trends if they are presented visually.

What is Python?

Python is a high-level programming language designed with readability and ease of use in mind. It is supported on a number of operating systems including Windows, Mac OS, and variants of Unix. Versions also exist for virtual machines such as Java and .NET. It was released as Open Source, meaning that you can use it for personal or commercial applications without fear of licensing issues. It is considered by most to be a scripting language, meaning that the commands exist in a text file (.PY extension), and are interpreted as they are executed. Python can also be compiled (.PYC extension) and run natively on a computer.

How is Data Visualization Accomplished in Python?

Like most computer languages, Python doesn't provide Data Visualization capabilities on its own. Now, it can load information and process it without difficulty, as it has fairly good file handling and number crunching capabilities. But, for the rendering, it needs help. It makes use of third party libraries for that purpose. An example of Python code using matplotlib looks something like:

matplotlib Example

The result would be a histogram of the input data.

To unlock this lesson you must be a Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use

Become a member and start learning now.
Become a Member  Back
What teachers are saying about
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account