Can anyone tell me what is the difference between scatter and plot commands in Matlab?
조회 수: 78 (최근 30일)
이전 댓글 표시
Hi I am new to matlab and going through basics. I am trying to plot points in Matlab HOwever, plot(1,2,3,4)
and
scatter([1,3],[2,4])
give me the same results. So what is the difference between plot and scatter command?
댓글 수: 2
vthuongt
2015년 11월 17일
이동: Dyuman Joshi
2024년 3월 1일
Is there any difference in speed and memory usage?
Walter Roberson
2015년 11월 17일
이동: Dyuman Joshi
2024년 3월 1일
채택된 답변
Hugo
2013년 6월 26일
scatter draws points without lines connecting them whereas plot may or may not plot the lines, depending on the arguments.
scatter returns a handle to an object called scattergroup whereas plot returns a handle to an object called lineseries. The scattergroup object has some properties (for example, for associating the size of the dots to a variable in the workspace) that are not present in the lineseries objects. Analogously, the lineseries has some properties (for exmaple, for controlling the type of lines) that are not present in the scattergroup object.
scatter allows you to specify a different colour and a different size for each point individually. It is not possible to do that with plot.
Hope this helps.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Scatter Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!