pbPassingBI
/
8 questions

Visualisation & export — quiz

8 questions covering this module. Charts with matplotlib and seaborn, then getting results out.

  1. Why call savefig before show?

    1. It is faster
    2. show clears the figure, producing a blank file
    3. savefig needs the window
    4. Order does not matter

    Answer: show clears the figure, producing a blank file — A classic cause of empty PNGs.

  2. What does tight_layout fix?

    1. Colours
    2. Labels and titles being cropped
    3. Slow rendering
    4. Missing data

    Answer: Labels and titles being cropped — It adjusts spacing so nothing is cut off.

  3. Why must a bar chart y-axis start at zero?

    1. Convention
    2. Bar length encodes value, so truncation misleads
    3. It errors otherwise
    4. For colour scaling

    Answer: Bar length encodes value, so truncation misleads — A truncated axis exaggerates small differences.

  4. Which chart answers "are these two measures related"?

    1. Line
    2. Bar
    3. Histogram
    4. Scatter

    Answer: Scatter — Scatter plots show relationships between two numeric measures.

  5. Why does seaborn need long-form data?

    1. It is faster
    2. hue and col reference a column of categories
    3. It cannot read wide data
    4. To save memory

    Answer: hue and col reference a column of categories — The grouping variable must be a column, not spread across columns.

  6. Which shows median, quartiles and outliers per category?

    1. Histogram
    2. Box plot
    3. Scatter
    4. Heatmap

    Answer: Box plot — Box plots compare distributions across categories.

  7. Why pass index=False to to_csv?

    1. It is faster
    2. Otherwise the index becomes an unnamed extra column
    3. It is required
    4. To handle nulls

    Answer: Otherwise the index becomes an unnamed extra column — That stray column compounds on every round trip.

  8. For a chart going into a slide deck, prefer:

    1. PNG at 72 dpi
    2. SVG
    3. JPG
    4. PDF only

    Answer: SVG — Vector output stays sharp at any size.