Hello,
I have two matrices V(NXM) and g(NXM). I wish to plot each column in V (x axis) against each column in g(y axis). I must have the data plotted only as markers i.e without lines.
I tried 'LineStyle','none' but I didn't managed to "turn on" the marker stuff. I do not want to specify manually what markers to use beacuse I have many columns (which I will also plot on separate figures).
I thought that matlab can plot the markers and once it finished all the markers it will change color and restart the marker order.
so can I do this?
Thanks, Rami

 채택된 답변

Friedrich
Friedrich 2014년 3월 20일

5 개 추천

Hi,
sounds like you are looking for the scatter or scatter3 function.

댓글 수: 1

Arnab Joardar
Arnab Joardar 2025년 8월 7일
I specifically needed it to create a dummy marker for the legend.
I used Scatter to create the marker of my desired size, but the legend marker associated with it was way too small to be visible.
So I used plot to make a dummy marker, to be used only in legend, like this.
I needed to set a custom marker edge thickness, but that was also tide to the line thickness. So, in the legend for this dummy marker, a narrow line also showed up along with my desired marker. I needed to get rid of that line in the legend and keep only the marker.

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

TheStranger
TheStranger 2018년 12월 5일

19 개 추천

Hi!
I know it was like 4 years ago, but anyway.
You need to specify 'LineStyle', 'none'

댓글 수: 3

Thanks for answering. Just what I needed
Quinn Mulligan
Quinn Mulligan 2021년 6월 10일
Thanks for answering anyway, you saved me a lot of time
Esen Ozbay
Esen Ozbay 2021년 7월 1일
Thanks so much! Just what I was looking for since scatter was working problematic.

댓글을 달려면 로그인하십시오.

Rami
Rami 2014년 3월 20일

1 개 추천

Hey , thanks for the answer but it doesn't work so good. I want the program to chose marker style and color much like the "plot" command chooses line color when you plot more than one vector / matrix.

댓글 수: 2

The color is choosen like the plot command does it. Only the marker has to be set by yourself which is extremly easy, e.g.
x = linspace(0,3*pi,200);
y = cos(x)+ rand(1,200);
scatter(x,y)
hold on
x = 0:0.1:10
y = sin(x);
scatter(x,y,'*')
hold off
Ihaveaquest
Ihaveaquest 2022년 8월 22일
wha if i wanted to just plot markers at oint 0 and 10??

댓글을 달려면 로그인하십시오.

Yash Doshi
Yash Doshi 2021년 2월 23일
편집: Yash Doshi 2021년 2월 23일

1 개 추천

You can also use the 'LineStyle','none' in the stem() function, and yes, MATLAB itself knows when to change markers for different columns, you just need to plot each column in a loop using (hold on).
Hope this answers and solves your query.
I know I have been very early in answering the question xD. But maybe it can be useful for anyone who sees this in the future.

카테고리

도움말 센터 및 File Exchange에서 Annotations에 대해 자세히 알아보기

질문:

2014년 3월 20일

댓글:

2025년 8월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by