Plots for MATLABs
MATLAB plots are visualisations made with functions such as plot, scatter, bar, histogram and surf. A figure contains axes, and you control titles, labels, legends, line styles and colours through function arguments or properties, then export the figure as an image for reports.
Stage: Data and Visualisation · Part of the MATLAB roadmap · Last reviewed 19 November 2026
What to learn in Plots
- Draw line and scatter plots with labelled axes, titles and legends
- Place several plots in one figure using tiledlayout or subplot
- Customise line style, marker and colour through name-value arguments
- Create histograms and bar charts to compare distributions and categories
- Export a figure to PNG or PDF with exportgraphics
Plots interview questions
How do you add multiple lines to the same plot?
Call hold on after the first plot so new plots draw on the same axes, or pass several x and y pairs to a single plot call. Add a legend with the legend function, and call hold off when finished.
What does subplot or tiledlayout do?
Both arrange several axes in a grid inside one figure. subplot is the older function that takes rows, columns and position. tiledlayout is newer and manages spacing and shared titles better. Use either to compare related plots side by side.
Where Plots fits in the MATLAB roadmap
Plots belongs to the Data and Visualisation stage (beginner level). Analyse and plot.
Other units in this stage
Back to the full MATLAB roadmap