plot
Plot timeseries
Description
Examples
Input Arguments
Tips
The
plot
function generates titles and axis labels automatically. These labels are:Plot Title —
'Time Series Plot: <name>'
where
<name>
is the string assigned tots.Name
, or by default,'unnamed'
X-Axis Label —
'Time (<units>)'
where
<units>
is the value of thets.TimeInfo.Units
field, which defaults to'seconds'
Y-Axis Label —
'<name>'
where
<name>
is the string assigned tots.Name
, or by default,'unnamed'
You can place new time series data on a time series plot (by setting
hold on
, for example, and issuing anothertimeseries/plot
command). When you add data to a plot, the title and axis labels become blank strings to avoid labeling confusion. You can add your own labels after plotting using thetitle
,xlabel
, andylabel
commands.Time series events, when defined, are marked in the plot with a circular marker with red fill. You can also specify markers for all data points using a
linespec
or name/value syntax in addition to any event markers your data defines. The event markers plot on top of the markers you define.The value assigned to
ts.DataInfo.Interpolation.Name
controls the type of interpolation theplot
method uses when plotting and resampling time series data. Invoke thetimeseries
methodsetinterpmethod
to change default linear interpolation to zero-order hold interpolation (staircase). This method creates a newtimeseries
object, with which you can overwrite the original one if you want. For example, to cause time seriests
to use zero-order hold interpolation, type the following:ts = ts.setinterpmethod('zoh');
Version History
Introduced before R2006a