フィルターのクリア

dynamic capsule list color

1 回表示 (過去 30 日間)
Alexander Maier
Alexander Maier 2021 年 3 月 24 日
コメント済み: Alexander Maier 2021 年 3 月 28 日
Hello,
I have a Program, which iterates multiple objects an n amount of steps into the future. For this I use the dynamic capsule list.
Finally there is a visualisation of the capsules with
show(capList, 'TimeStep',1:capList.MaxNumSteps,'FastUpdate',1, 'ShowCollision', true);
drawnow;
For visual purposes I would like the capsules to be displayed in different colors and maybe add some additional capsules in a certain color. How could I manually set the color in this case? Thank you in advance!

採用された回答

Adam Danz
Adam Danz 2021 年 3 月 24 日
I'm not familiar with dynamicCapsuleList objects at all but played around with it a bit. The object colors are defined by patch objects burried in a series of hggroups and hgtransforms. The patch colors are in the CData or FaceColor properties of the patch objects.
I don't know whether the color can be specified as input properties but here's how to change color after the objects are rendered.
Get handles to all ObstacleListEgoGroups
OLEG = findobj(gca, 'Tag','ObstacleListEgoGroup');
Get handles to the patches within the group
ph = findobj(OLEG, 'Type', "Patch");
Set the color of the first patch obj to red
ph(1).FaceColor = 'r';
To set a transition of colors set FaceColor to 'flat' and define the CData values (see patch documentation).
  1 件のコメント
Alexander Maier
Alexander Maier 2021 年 3 月 28 日
Thanks, your help is much appreciated!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Properties についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by