how to add a STAR or Triangle shape to plot simply without knowing their vertex?

155 ビュー (過去 30 日間)
roudan
roudan 2021 年 7 月 15 日
コメント済み: roudan 2021 年 7 月 16 日
Hi
I have a contourf. I'd like to just add a simple Star or Triangular shape to certian location within the plot. I am thinking to use Patch() but patch still requires to provide the vertext of this Star or triangular shape in order to draw it. Is there a command to add this shape without knowing their vertex? Thanks

採用された回答

Jonas
Jonas 2021 年 7 月 15 日
編集済み: Jonas 2021 年 7 月 15 日
smth. like that probably
Z = peaks;
contourf(Z); hold on;
plot(15,10,'rp','MarkerSize',15,'MarkerFaceColor','r')
all markers can be found here, there are also triangles and hexagonal stars
  3 件のコメント
Jonas
Jonas 2021 年 7 月 16 日
hi roudan, you can show your code how you saved your handles. the following worked for me without problems:
Z = peaks;
contourf(Z); hold on;
mark=plot(15,10,'rp','MarkerSize',15,'MarkerFaceColor','r');
delete(mark)
roudan
roudan 2021 年 7 月 16 日
Thanks Jonas

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by