Setting LineWith property for all lines by point-notation
古いコメントを表示
Hi,
Why can't the LineWidth property be set by point notation (for all Children of an axes object at once)? As far as i know, this worked in some earlier version - but i'm not sure about this. I'm using Matlab R2016b.
Example:
y = rand(10, 3);
x = 1:10;
hAx = axes();
plot(hAx, x, y);
%hAx.Children.LineWidth = 5; % <-- this won't work
set(hAx.Children, 'LineWidth', 5) % ..but this
Then again, this will work (for line 1):
hAx.Children(1).LineWidth = 3;
Children is a array (of lines), so setting all its values by a scalar should be possible(?)
The errormessage is: Expected one output from a curly brace or dot indexing expression, but there were 3 results.
Greetings and thanks in advance!
採用された回答
その他の回答 (1 件)
Walter Roberson
2016 年 11 月 19 日
When you use dot notation you are pretty much using structure semantics so haX.Children.LineWidth is pretty much structure expansion
[haX.Children.LineWidth] = deal(5)
Might possibly work, perhaps
カテゴリ
ヘルプ センター および File Exchange で Creating, Deleting, and Querying Graphics Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!