how to fill circle markers with crosses?

18 ビュー (過去 30 日間)
Zhe Dong
Zhe Dong 2024 年 3 月 25 日
コメント済み: Zhe Dong 2024 年 3 月 31 日
Is there a way I can fill the circle markers with crosses instead of colours? just for the aesthetic purpose. Examples are in the attached pic below.
I guess one workaround is to plot crosses at the same data points, but that will mess up the legends and other things, is there a neater way of doing this?
  2 件のコメント
Mathieu NOE
Mathieu NOE 2024 年 3 月 25 日
Zhe Dong
Zhe Dong 2024 年 3 月 31 日
Thanks for the suggestion! but I think it doesn't have the markers I want

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

採用された回答

the cyclist
the cyclist 2024 年 3 月 25 日
編集済み: the cyclist 2024 年 3 月 25 日
I'm guessing it's a bit sloppy for your purposes, but one can overstrike plots with two markers:
rng(31)
x = rand(7,1);
y = rand(7,1);
figure
hold on
plot(x,y,'o','color','r')
plot(x,y,'+','color','r')
plot(y,x,'o','color','b')
plot(y,x,'x','color','b')
  2 件のコメント
Catalytic
Catalytic 2024 年 3 月 26 日
Sloppy why? Because the overstrikes are not snug inside their outer circles? That can be ameliorated by playing with the relative MarkerSizes.
rng(31)
x = rand(7,1);
y = rand(7,1);
figure
hold on
plot(x,y,'o','color','r','MarkerSize',14)
plot(x,y,'+','color','r','MarkerSize',13)
plot(y,x,'o','color','b','MarkerSize',14)
plot(y,x,'x','color','b','MarkerSize',13)
Zhe Dong
Zhe Dong 2024 年 3 月 30 日
Thanks both! however this is still not the way I'd like it to be, as I don't feel like accomplishing this by adding more plots, but I guess there's no better ways at this stage, thanks for the ideas though, much appreciated!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by