How to mark one specific point when plotting
이전 댓글 표시
Hi,
Consider the following plot:
x = linspace(0,10)
y = x.^2
plot(x,y,'b+-')
What type of command can I use to mark one specific point on the line, e.g. y(2), with a square size 15?
Cheers,
A MATLAB newbie
채택된 답변
추가 답변 (1개)
Ali Isik
2011년 10월 14일
As I understood you should 'hold on' the plot and plot the colored,squared point on it. The modified code is as follows;
x = linspace(0,10);
y = x.^2;
plot(x,y,'b+-');
hold on;
plot(x(2),y(2),'--rs','LineWidth',2,'MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',15);
댓글 수: 1
Walter Roberson
2011년 10월 14일
Note: that 15 will be 15 points.
Reminds me about the riddle of St. Ives...
카테고리
도움말 센터 및 File Exchange에서 Stochastic Differential Equation (SDE) Models에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!