MATLAB Answers

How to keep a patch object and its rotation in the same plot

71 ビュー (過去 30 日間)
GreenPiece 2019 年 2 月 16 日
コメント済み: Walter Roberson 2019 年 2 月 16 日
How can I keep the two following objects in the same plot. I tried to use 'hold on' but I did not work. I think that the object is dissappeared after rotating but I could not find a solution. (I have read this: But it could not help)
bot = patch(x,y,'blue');
hold on
rotate(bot, [0 0 1], 45)

  0 件のコメント

サインイン to comment.


Star Strider
Star Strider 2019 年 2 月 16 日
Try this:
x = [1 2 2 1];
y = [1 1 2 2];
bot = patch(x,y,'blue');
rotate(bot, [0 0 1], 45)
hold on
hold off
axis equal
You did not specify what your ‘x’ and ‘y’ are. This works with mine. It simply requires a second patch call.

  1 件のコメント

Walter Roberson
Walter Roberson 2019 年 2 月 16 日
alternatively copyobj the patch before rot()

サインイン to comment.

その他の回答 (0 件)

サインイン してこの質問に回答します。


Translated by