This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Discrete Data Plots

Bar graphs, scatter plots, and more

Visualize discrete data using plots such as bar graphs or stem plots. For example, you can create a vertical or horizontal bar graph where the bar lengths are proportional to the values that they represent.


expand all

barBar graph
barhPlot bar graph horizontally
bar3Plot 3-D bar graph
bar3hPlot horizontal 3-D bar graph
paretoPareto chart
stemPlot discrete sequence data
stem3Plot 3-D discrete sequence data
scatterScatter plot
scatter33-D scatter plot
stairsStairstep graph


expand all

Bar PropertiesBar chart appearance and behavior
Stem PropertiesStem chart appearance and behavior
Scatter PropertiesScatter chart appearance and behavior
Stair PropertiesStair chart appearance and behavior


Types of Bar Graphs

Bar graphs are useful for viewing results over a period of time, comparing results from different data sets, and showing how individual elements contribute to an aggregate amount.

Modify Baseline of Bar Graph

This example shows how to modify properties of the baseline of a bar graph.

Overlay Bar Graphs

This example shows how to overlay two bar graphs and specify the bar colors and widths.

Bar Chart with Error Bars

Create a bar chart with error bars using both the bar and errorbar functions.

Color 3-D Bars by Height

This example shows how to modify a 3-D bar plot by coloring each bar according to its height.

Combine Line and Stem Plots

This example shows how to combine a line plot and two stem plots.

Overlay Stairstep Plot and Line Plot

This example shows how to overlay a line plot on a stairstep plot.

Interpolating Scattered Data

Interpolating scattered data using scatteredInterpolant.

Related Information