slrealtime.instrument.LineStyle
Description
An slrealtime.instrument.LineStyle
object defines line style
properties for a connectLine
function.
Creation
creates an empty instrument lineStyle_object
= slrealtime.instrument.LineStyle()LineStyle
object for setting line style
properties.
Properties
Color
— Line color
[-1 -1 -1]
(auto select) (default) | 'red'
| 'r'
| 'green'
| 'g'
| 'blue'
| 'b'
| 'cyan'
| 'c'
| 'magenta'
| 'm'
| 'yellow'
| 'y'
| 'black'
| 'k'
| 'white'
| 'w'
Select the line color.
Example:
myLineStyle.Color = 'black';
Marker
— Marker character
'none'
(default) | +'
| 'o'
| '*'
| '.'
| 'x'
| 'square'
| 'diamond'
| 'v'
| '^'
| '>'
| '<'
| 'pentagram'
| 'hexagram'
Select the marker character in the line.
Example:
myLineStyle.Marker = '*';
MarkerSize
— Marker character size
6
(default) | positive scalar value
Select the marker character size in the line.
Example:
myLineStyle.MarkerSize = 4;
Style
— Line style character
'-'
(default) | '--'
| ':'
| '-.'
Select the line style character.
Example:
myLineStyle.Style = '--';
Width
— Line width
0.5
(default) | positive scalar value
Select the line width.
Example:
myLineStyle.Width = 1;
Label
— Line label
character vector
Select a line label.
Example:
myLineStyle.Label = 'My Line';
Examples
Configure Line Style Properties for connectLine
You can configure style properties in a
LineStyle
object and apply the style in theconnectLine
function.tg = slrealtime; removeAllInstruments(tg); % next assumes that real-time application has been built mldatxfile = 'slrt_ex_pendulum_100Hz.mldatx'; hInst = slrealtime.Instrument(mldatxfile); myLineStyle = slrealtime.instrument.LineStyle(); myLineStyle.Marker = '*'; myLineStyle.MarkerSize = 4; myLineStyle.Color = 'black'; myLineStyle.Label = 'Cart Position'; hAxis = uiaxes (); legend(hAxis); connectLine(hInst,hAxis,'cartposition', ... 'LineStyle', myLineStyle); addInstrument(tg,hInst); load(tg,mldatxfile); start(tg); pause(10); stop(tg);
Version History
Introduced in R2022bR2024a: Set Label Property for LineStyle object
Information is available for the slrealtime.instrument.LineStyle
function Label
property.
See Also
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)