Skip to content

bar

Vertical bar chart.

h = bar(y, ...)
h = bar(x, y, ...)

Vertical bars at each x with height y. With matrix y, draws grouped bars (one group per row).

bar(1:5, [3 5 2 4 6])
bar([1 2 3], [10 20 15; 12 18 22]) % 3 groups of 2
  • barh — Horizontal bar chart.
  • bar3 — 3D bar chart.
  • histogram — Histogram of data.
  • area — Area plot — line plot with filled area below.