Rev | Line | |
---|
[37] | 1 | function set_linespec(h,linespec)
|
---|
| 2 | % SET_LINESPEC Set the color and line style of a graphics object.
|
---|
| 3 | % SET_LINESPEC(h,linespec) will set the color and line style of a graphics
|
---|
| 4 | % object, using the linespec convention of 'plot', e.g.
|
---|
| 5 | % set_linespec(h,'g:')
|
---|
| 6 | % set_linespec(h,'r--')
|
---|
| 7 |
|
---|
| 8 | % break linespec into color and linestyle.
|
---|
| 9 | [linestyle, color, marker, msg] = colstyle(linespec);
|
---|
| 10 | if ~isempty(msg)
|
---|
| 11 | error(msg)
|
---|
| 12 | end
|
---|
| 13 | if length(color) > 0
|
---|
| 14 | set(h,'color',color);
|
---|
| 15 | end
|
---|
| 16 | if length(linestyle) > 0
|
---|
| 17 | set(h,'linestyle',linestyle);
|
---|
| 18 | end
|
---|
| 19 | if length(marker) > 0
|
---|
| 20 | set(h,'marker',marker);
|
---|
| 21 | end
|
---|
Note: See
TracBrowser
for help on using the repository browser.