Matplotlib figures for notebooks, slides and print: how do you choose size, DPI and output format?

Quick Overview

Asks how to adapt a Matplotlib or Seaborn figure for a notebook, a slide deck and a printed report. Tests understanding of how figure size, DPI and font point sizes interact, and when to choose vector or raster output formats.

Matplotlib figures for notebooks, slides and print: how do you choose size, DPI and output format?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: easy

Interview Round: Other

When adapting a figure for different mediums like a notebook, slide deck, or printed report, what considerations would you make regarding size, DPI, and output format? Assume the figures are made with Matplotlib or Seaborn. ```hint Physical size first Pixel dimensions are `figsize` times DPI, and font sizes are in points relative to the figure's physical size. Ask what happens to a 10 pt axis label when a large figure is shrunk to fit a page column. ``` ### What a Strong Answer Covers - How `figsize`, DPI and font point sizes together set the final pixel size and whether text stays legible - What changes for each medium: on-screen notebook, projected slide, printed page - When to pick vector or raster output, and which file formats suit each medium - Practical details such as aspect ratio, contrast, and font embedding for print ### Follow-up Questions - A scatter plot with two million points produces a very large PDF that is slow to open. What would you change? - How would you set up plotting code so the same chart can be exported for a notebook, a slide and a report without copying style settings around? - The report will be printed in grayscale. What do you change in the figure?

Overview: Asks how to adapt a Matplotlib or Seaborn figure for a notebook, a slide deck and a printed report. Tests understanding of how figure size, DPI and font point sizes interact, and when to choose vector or raster output formats.

PracHub logo
General
Nov 24, 2026
easyData ScientistOtherData Manipulation (SQL/Python)
0
0

When adapting a figure for different mediums like a notebook, slide deck, or printed report, what considerations would you make regarding size, DPI, and output format? Assume the figures are made with Matplotlib or Seaborn.

What a Strong Answer Covers Guidance

  • How figsize , DPI and font point sizes together set the final pixel size and whether text stays legible
  • What changes for each medium: on-screen notebook, projected slide, printed page
  • When to pick vector or raster output, and which file formats suit each medium
  • Practical details such as aspect ratio, contrast, and font embedding for print

Follow-up Questions Guidance

  • A scatter plot with two million points produces a very large PDF that is slow to open. What would you change?
  • How would you set up plotting code so the same chart can be exported for a notebook, a slide and a report without copying style settings around?
  • The report will be printed in grayscale. What do you change in the figure?