필터 지우기
필터 지우기

marker size difference between 'plot' and 'scatter' function

조회 수: 26 (최근 30일)
Yu Li
Yu Li 2019년 4월 3일
댓글: Robert Mehlig 2024년 6월 24일 8:20
if using the same size, the plotting result using 'plot' function and 'scatter' function are significantly different.
to keep them consistent, what is the relation, or, is there any relation between the size of 'scatter' and 'plot' function?
below is the test code:
figure
scatter(1:5,1:5,20)
figure
plot(1:5,1:5,'o','MarkerSize',20)
Thanks!
Yu

채택된 답변

dpb
dpb 2019년 4월 3일
Per the documentation, scatter marker size property is marker proportional to area while the line marker property is proportional to diameter. The default values are 36 and 6 points, respectively, so they are the same visually by default. Use squared value of radius for line marker as area for scatter and they'll stay the same.
  댓글 수: 2
Yu Li
Yu Li 2019년 4월 3일
Thank you!
Robert Mehlig
Robert Mehlig 2024년 6월 24일 8:20
Stumbled upon this whilst searching for the same thing regarding Python's Matplotlib library. Since it is based on MATLAB, the same thing applies there. I put,
scatter_size = 6
plot_size = 4*np.sqrt(scatter_size)/np.pi

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by