Black Friday Sale! Get 90% off all courses!

Why Matplotlib Figure Inches Don't Match Your Screen Inches and How to Fix it

matplotlib Dec 09, 2021
 

Why Matplotlib Figure Inches Don't Match Your Screen Inches and How to Fix it

If you've worked with the matplotlib data visualization library before, then you'll be familiar with the term figsize, which is measured in figure inches. These default to 6.4 inches in width by 4.8 inches in height. But, if you actually measured the physical screen inches on your monitor, you're likely to get different numbers. This post details why this mismatch exists and how to change the...

Continue Reading...

Instantly Beautify Matplotlib Plots by Viewing all Available Styles

In this post, you'll learn about the different available matplotlib styles that can instantly change the appearance of the plot. Let's begin by making a simple line plot using the default style. This simple style is often the first (and sometimes only) style that many people encounter with matplotlib not realizing how easy it is to choose others.

In [1]:
import matplotlib.pyplot as plt import numpy as np x = np.arange(-2, 8, .1) y = .1 * x ** 3 - x ** 2 + 3 * x + 2 fig, ax...
Continue Reading...
Close

Register for a free account

Upon registration, you'll get access to the following free courses:

  • Python Installation
  • Intro to Jupyter Notebooks
  • Intro to Pandas
  • Python  and Pandas Challenges