how to fill circle markers with crosses?
조회 수: 22 (최근 30일)
이전 댓글 표시
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. ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1650971/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1650971/image.jpeg)
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?
채택된 답변
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
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)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!