10.10: Scatter Plots

Fundamentals of MATLAB Programming · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-NC-SA, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    10.10: Scatter Plots

    A scatter plot displays individual points without necessarily connecting them. This is useful when you want to see whether two variables appear to be related. For example, you might plot study time versus exam score, or temperature versus energy use.

    Example \(\PageIndex{1}\)

    Plotting exam scores vs. study hours.

    clear; clc; clf;
    
    studyHours = [1 2 2.5 3 4 4.5 5 6];
    scores = [62 68 71 75 82 85 88 94];
    
    scatter(studyHours, scores, 'filled')
    xlabel('Study Time (hours)')
    ylabel('Exam Score')
    title('Study Time vs. Exam Score')
    grid on
    
    Solution

    clipboard_e67a8dfc724d8f6122181228b9c8c578f.png

    Unlike a line plot, a scatter plot does not imply that the points should be connected in order. It emphasizes the individual data points and the overall relationship between the variables.


    This page titled 10.10: Scatter Plots was last modified on Tue, 30 Jun 2026 02:11:46 GMT and is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Zara Noroozi.