fliping a contour plot while maintaining the original.

11 ビュー (過去 30 日間)
Dylan Bull
Dylan Bull 2021 年 8 月 21 日
編集済み: Walter Roberson 2021 年 8 月 21 日
hello all, i am trying to flip a contourplot but i want to have it show the original and the flipped picture on the same graph. i have included a picture to show that i want this plot to be flipped about the y axis while still mainting the original contour as they should be identical but flipped if that makes sense.

採用された回答

Walter Roberson
Walter Roberson 2021 年 8 月 21 日
Consider for a moment the center partial ellipse. At the moment, it is a truncated ellipse, with a straight line running along the edge of it.
Now, if you were to flip the contourplot and put the new one immediately beside the current one, assuming you could get the edges to line up, what you would see would not be a full ellipse: it would be a full ellipse with a line down the middle. Is that what you would want?
If it is what you would want, then it is possible to copy the existing contour object, and then in the copy, take the negative of the X coordinates. There would be a line through the middle if you did this.
If you do not want the line down the middle, then you should mirror your data in an array, and do a single contour based on that. It is easiest to do that while you still have the data on hand in variables, but it is also possible to grab the values out of the contour object and contour based on that plus its mirror, and adjust the data in the original contour object.
  6 件のコメント
Dylan Bull
Dylan Bull 2021 年 8 月 21 日
also i could do this with x and y but wouldnt i need to change the x value to be negative at least in order to flip it over the x axis. so in this case i would need it to be equal but opposite on the x axis. but the values for T should all be the same. if that makes sense?
Dylan Bull
Dylan Bull 2021 年 8 月 21 日
編集済み: Walter Roberson 2021 年 8 月 21 日
nvm your
newnewZ = [Z, fliplr(Z)];
did exactly what i needed it to without a line.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by