Leanpub Header

Skip to main content

Data Visualization Made Easy

Creating Beautiful Charts in Python with Matplotlib

Data Visualization Made Easy
This book is 100% completeLast updated on 2026-12-02

Minimum price

$15.00

$22.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
About

About

About the Book

Data Visualization Made Easy: Creating Beautiful Charts in Python with Matplotlib is a practical, hands-on guide to learning data visualization with Matplotlib, one of the most widely used visualization libraries in Python. This book will take you from creating basic charts to building more advanced visualizations, giving you the skills and confidence to present your data clearly and effectively.

What You Will Learn

The book is divided into two parts, taking you from the fundamentals of chart creation to more advanced visualization techniques.

In the first part, you will learn how to create a variety of charts using Matplotlib, including line charts, scatter plots, bar charts, histograms, and other common visualizations. You’ll also see when to use each type and how to pick the best one for your data.

In the second part, you’ll learn how to customize your charts and have more control over how they look. You’ll see how to arrange several plots, choose colors, adjust axes and ticks, add text and annotations, and use coordinate systems to position elements precisely. These skills will help you make professional visualizations for your projects and presentations.

A Hands-On Approach

Rather than relying on made-up examples, this book uses real-world datasets to demonstrate visualization techniques. You will work with data from different fields and organizations, exploring practical examples that show how Matplotlib can be used to understand and communicate information.

Each chapter builds on the concepts introduced earlier and includes practical exercises to help you apply what you have learned. The source code, Jupyter notebooks, and datasets are also available in the accompanying GitHub repository, so you can follow along with the examples and experiment with the techniques yourself.

Who Is This Book For?

This book is suitable for anyone interested in learning data visualization with Python. Whether you are a student, data analyst, researcher, or professional who works with data, you will find practical techniques that you can apply in your own work.

Some experience with Python, familiarity with Pandas, and basic knowledge of Jupyter Notebook are recommended. You do not need any prior experience with Matplotlib.

By the end of this book, you’ll have a strong understanding of Matplotlib and the practical skills to create and customize a wide range of data visualizations.

Author

About the Author

Bhola Prasad

Bhola Prasad is an electronics engineer, data scientist, and author with over five years of experience in technical writing. He has a keen interest in Python programming and data visualization, and enjoys making complex technical concepts easier to understand. He is also working on other books in the Made Easy series, with the aim of simplifying complex subjects and helping readers learn more effectively.

Contents

Table of Contents

Preface

  1. Why learn Data Visualization
  2. Why Python and Matplotlib
  3. Who should read this book
  4. How this book is organized
  5. Prerequisites
  6. Download code
  7. Acknowledgements

1. Line Chart

  1. Create a line chart
  2. Simple line charts
  3. Title and axis labels
  4. Multiple line charts
  5. Add a legend
  6. Line style and width
  7. Line color
  8. Add markers
  9. Format string
  10. Figure size
  11. Axis limits
  12. Labeling lines directly
  13. Highlighting a line
  14. Plotting categorical variables
  15. Area chart
  16. Stacked area chart
  17. Style sheets
  18. Save a figure
  19. Interactive charts
  20. Exercises
  21. Solutions

2. Scatter Plot

  1. Create a scatter plot
  2. Marker color
  3. Marker style
  4. Marker size
  5. Bubble chart
  6. Transparent markers
  7. Scatter plot with a legend
  8. Adding a regression line
  9. Adding a reference line
  10. Customizing matplotlib with rcParams
  11. Create a custom matplotlib style sheet
  12. Exercises
  13. Solutions

3. Bar Chart

  1. Create a bar chart
  2. Adding colors to bars
  3. Adding grid lines
  4. Bars width
  5. Horizontal bar chart
  6. Bar chart with labels
  7. Stacked bar chart
  8. Grouped bar chart
  9. Broken horizontal bar chart
  10. Exercises
  11. Solutions

4. Histogram

  1. Create a histogram
  2. Histogram bar color
  3. Multiple histograms
  4. Bin width
  5. Histogram types
  6. Edge color
  7. Face color
  8. Line style and width
  9. Hatch style
  10. Normalizing histograms
  11. Histogram bars alignment
  12. Horizontal histogram
  13. 2D Histogram
  14. Exercises
  15. Solutions

5. Box and Violin Plot

  1. Create a box plot
  2. Multiple box plots
  3. Show means
  4. Show outliers
  5. Customizing the box
  6. Customizing the whiskers
  7. Customizing the outliers
  8. Customizing the median and mean
  9. Adding fill colors
  10. Notched box plot
  11. Horizontal box plot
  12. Violin plot
  13. Multiple violin plots
  14. Showing the mean and median
  15. Showing min and max values
  16. Showing quantiles
  17. Showing side
  18. Horizontal violin plot
  19. Changing violin plot colors
  20. Exercises
  21. Solutions

6. Pie Chart

  1. Create a pie chart
  2. Adding percentage labels
  3. Coloring the slices
  4. Hatching the slices
  5. Positioning labels and percentages
  6. Explode slices
  7. Adding a shadow
  8. Changing the start angle
  9. Changing the pie size
  10. Pie chart direction
  11. Donut chart
  12. Adding a legend
  13. Alternative to pie chart
  14. Exercises
  15. Solutions

7. Axes or Subplots

  1. Figure
  2. Axes
  3. Axis
  4. Subplots
  5. Sharing axes
  6. Subplot spacing and margins
  7. Exercises
  8. Solutions

8. Arranging Multiple Axes in a Figure

  1. Creating multiple axes
  2. Basic 1 x 2 grid
  3. Basic 2 x 1 grid
  4. Basic 2 x 2 grid
  5. Axes spanning rows or columns in a grid
  6. String shorthand
  7. Variable widths and heights in a grid
  8. Nested axes layouts
  9. Low-level axes layout
  10. Exercises
  11. Solutions

9. Axis Ticks & Scales

  1. Axis autoscaling & margins
  2. Scales
  3. Ticks
  4. Tick parameters
  5. Tick locators & formatters
  6. Plotting dates
  7. Date tick locators
  8. Date tick formatters
  9. Align tick labels
  10. Secondary axis
  11. Multilevel ticks
  12. Center labels between ticks
  13. Exercises
  14. Solutions

10. Legend

  1. Create a legend
  2. Legend customizations
  3. Legend title
  4. Legend labels
  5. Labels color
  6. Legend frame
  7. Legend border padding
  8. Legend label spacing
  9. Legend handle size & spacing
  10. Legend marker position
  11. Legend columns and spacing
  12. Legend location
  13. Figure legend
  14. Multiple legends on the same axes
  15. Create custom legend
  16. Exercises
  17. Solutions

11. Artists

  1. Creating artists
  2. Circles
  3. Rectangles
  4. Wedge
  5. Polygon
  6. Ellipse
  7. Arc
  8. Arrow
  9. Path
  10. Bézier curves
  11. Compound paths
  12. Exercises
  13. Solutions

12. Color

  1. Specifying colors
  2. Color cycles
  3. Colormaps
  4. Sequential colormaps
  5. Diverging colormaps
  6. Cyclic colormaps
  7. Qualitative colormaps
  8. Reversing colormaps
  9. Custom colormaps
  10. Registering custom colormaps
  11. Heatmaps
  12. Exercises
  13. Solutions

13. Text

  1. Adding text
  2. Text alignment
  3. Text styling
  4. Text rotation
  5. Multiline text
  6. Writing mathematical expressions
  7. Annotations
  8. Annotating with boxed text
  9. Annotation arrow styles
  10. Text highlighting
  11. Exercises
  12. Solutions

14. Bringing It All Together

  1. Child mortality
  2. Stock Market
  3. Exercises

Conclusion

  1. Where to go from here
  2. Share your feedback
  3. Get in touch

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub