DataTipTemplate - Data tip content and appearance - MATLAB (original) (raw)
DataTipTemplate Properties
Data tip content and appearance
DataTipTemplate
properties control the content and appearance of data tips. By changing property values, you can modify certain aspects of data tips.
p = plot(1:10); dtt = p.DataTipTemplate
Row content, specified as an array of DataTipTextRow objects.
You can modify the existing rows by setting properties of theDataTipTextRow
objects. Access a particular row by indexing into the array of objects.
Example: dtt.DataTipRows(1).Label = 'My label'
changes the label for the first row.
Example: dtt.DataTipRows(1).Value = 'YData'
changes the value source for the first row to use the YData
property of the plotted object.
Example: dtt.DataTipRows(1).Format = 'usd'
changes the value format for the first row.
Alternatively, you can add new rows to the data tip using thedataTipTextRow
function.
Example: dtt.DataTipRows(end+1) = dataTipTextRow(label,value)
adds a new row to the data tip with the specified label and value source.
Font
Font size, specified as a scalar value greater than zero in point units. One point equals 1/72
inch.
Tips
Control the behavior of data tips by modifying properties of the datatip object.
Version History
Introduced in R2019a