Main Content

bar, barh

bar, barh is not recommended. Use bar or barh instead.

Description

example

bar(tsobj) draws the columns of data series of the object tsobj. The number of data series dictates the number of vertical bars per group. Each group is the data for one particular date.

Note

Use the MATLAB® command shading faceted to put edges on the bars. Use shading flat to turn edges off.

example

bar(tsobj,width) specifies the width of the bars.

example

bar(___style) changes the style of the bar chart.

example

hbar = bar(___) returns a vector of bar handles.

example

barh(tsobj) draws the columns of data series of the object tsobj. The number of data series dictates the number of horizontal bars per group. Each group is the data for one particular date.

example

barh(tsobj,width) specifies the width of the bars.

example

barh(___style) changes the style of the bar chart.

example

hbar = barh(___) returns a vector of bar handles.

Examples

collapse all

This example shows how to create a bar chart for Disney stock showing high, low, opening, and closing prices.

load disney
bar(q_dis)
Warning: FINTS is not recommended. Use TIMETABLE instead. For more information, see <a href="matlab:web(fullfile(docroot, 'finance/convert-from-fints-to-timetables.html'))">Convert Financial Time Series Objects (fints) to Timetables</a>.
title('Bar Chart of Disney Prices')

Figure contains an axes object. The axes object with title Bar Chart of Disney Prices contains 4 objects of type bar. These objects represent OPEN, HIGH, LOW, CLOSE.

This example shows how to create a horizontal bar chart for Disney stock showing high, low, opening, and closing prices.

load disney
barh(q_dis)
Warning: FINTS is not recommended. Use TIMETABLE instead. For more information, see <a href="matlab:web(fullfile(docroot, 'finance/convert-from-fints-to-timetables.html'))">Convert Financial Time Series Objects (fints) to Timetables</a>.
title('Horizontal Bar Chart of Disney Prices')

Figure contains an axes object. The axes object with title Horizontal Bar Chart of Disney Prices contains 4 objects of type bar. These objects represent OPEN, HIGH, LOW, CLOSE.

Input Arguments

collapse all

Financial time series object, specified as a fints object.

Data Types: object

(Optional) Width of the bars and separation of bars within a group, specified as a positive numeric. If width is 1, the bars within a group touch one another. Values > 1 produce overlapping bars.

Data Types: double

(Optional) Type of grouping, specified as a character vector.

Data Types: double

Output Arguments

collapse all

Bar handles, returned as a vector.

Version History

Introduced before R2006a