Contour plot over a specified region

7 ビュー (過去 30 日間)
Claus E. Jebens
Claus E. Jebens 2022 年 6 月 28 日
コメント済み: Claus E. Jebens 2022 年 6 月 28 日
Hi, I want to do a contour plot over a speciefied region, for example a triangle or a 4-node element. These 4 node locations do NOT form a rectangle.

回答 (1 件)

Karim
Karim 2022 年 6 月 28 日
Using the patch command u can plot as many triangular or rectangular shapes at the same time.
Just build the grid (i.e. the 'vertices') and the a conectivity matrix (i.e. 'faces') to connect selected points from the grid.
% create a random grid
MyGrid = [-3.01 -2.82; % node 1
1.33 -1.31; % node 2
0.70 1.79; % node 3
-2.46 2.46]; % node4
figure
subplot(1,2,1)
patch('Faces', [1 2 3 4], 'Vertices', MyGrid,'FaceColor','none')
grid on
subplot(1,2,2)
patch('Faces', [1 2 4], 'Vertices', MyGrid,'FaceColor','none')
grid on
  1 件のコメント
Claus E. Jebens
Claus E. Jebens 2022 年 6 月 28 日
Thanks, however my question is how to do a countour plot over an arbitraray region defined by 3, 4 .. nodes. In particular I want to plot the shape function n(x,y) of the triange, quad over the element area. Data, like n(x,y) , sigma(x,y), temperature (x,y) ... are defined only whithin the element area.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by