Add markers at min max points in a triangular plot
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello, I wanted to add dots at the min, max points on the triangular plot that I have generated so that my final plot can look like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/167986/image.png)
Here is the code that I have so far:
ts=0.1;
t=-5:ts:5;
y=repmat(max(t)-abs(t),1,3);
t=-3:ts:-3+length(y)*ts-ts;
ty=[((t+10)*5)' ((y+10)*5)'];
plot(((t+10)*5)', ((y+10)*5)', '--r', 'Linewidth', 1.5);
댓글 수: 0
답변 (1개)
Kian Azami
2017년 10월 8일
You can change your code a little bit to have the results you want:
clc
close all
clear all
ts=0.1;
t=-5:ts:5;
y=repmat(max(t)-abs(t),1,3);
t=-3:ts:-3+length(y)*ts-ts;
ty=[((t+10)*5)' ((y+10)*5)'];
xData = ((t+10)*5)';
yData = ((y+10)*5)';
yIdx = find(yData == 50 | yData == 75);
yIdx = yIdx([1 2 3 5 6 8 9]);
plot(xData, yData, '--r', 'Linewidth', 1.5);
hold on
plot(xData(yIdx),yData(yIdx),'Marker','o','markersize',10,...
'MarkerFaceColor','k',...
'MarkerEdgeColor','r',...
'linestyle','none')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Map Display에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!