Plotting a red asterisk on a certain point

89 ビュー (過去 30 日間)
Ammar Babikir
Ammar Babikir 2018 年 2 月 4 日
コメント済み: Star Strider 2018 年 2 月 5 日
Hello MATLAB community,
I am trying to figure out how to label a specific point with a red asterisk on a 3D plot that I have. I attached a picture of the 3D plot that I get when I run my code.
There are two .m files that I put in the same folder in order to produce my specific plot: Problem_1.m and Potential.m (I attached them both). The main script that I run to produce the plot is the Problem_1.m file.
I have a 3D plot and I need to put a red asterisk on the [95 95] coordinate (or what I simply name as "loc" in my code) on my 3D plot. I tried using "markers" and "MarkerIndices" but it would always give me an error or give me something that I wasn't looking for.
I was wondering if anyone has had some experience with this. I would really appreciate your insight on it.

採用された回答

Star Strider
Star Strider 2018 年 2 月 4 日
I am not certain what result you want.
Try this:
figure ();
meshc(x,y,z(x,y));
hold on;
plot3(loc(1), loc(2), z(loc(1),loc(2)),'r.', 'markers', 30);
txt2 = '\leftarrow Location of Bot';
I replaced your plot call with a plot3 call.
Experiment to get the result you want.
  2 件のコメント
Ammar Babikir
Ammar Babikir 2018 年 2 月 5 日
Yes. Thank you. It gave me the result I need.
Star Strider
Star Strider 2018 年 2 月 5 日
As always, my pleasure.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by