Contour plot with function triplot
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi all,
I have a script which plots a structure:
clear; clc; clf;
% nodal coordinates.
coord = [0 0; 1 0; 2 0; 3 0; 0 1; 0.5 1; 1.5 1; 2.5 1; 3 1];
% connectivity.
conne = [1 6 5; 1 2 6; 2 7 6; 2 3 7; 3 8 7; 3 4 8; 4 9 8];
% y-displacements
ydis = [0 0 0 0 0.1 0.2 0.3 0.2 0.1]';
% y-deformed coordinates
coord_dis = [coord(:, 1) coord(:, 2) - ydis];
% plot the structure.
triplot(conne, coord_dis(:,1), coord_dis(:,2));
axis equal
The script gives me:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/170567/image.png)
Is it possible to make the plot a contour, which uses colour to denote different values in ydis, for example, darker colour with larger values in ydis?
Plot would be like this one:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/170570/image.png)
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Contour Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!