필터 지우기
필터 지우기

How to impose the size of the marker relative to the axis?

조회 수: 12 (최근 30일)
Luca
Luca 2014년 12월 10일
답변: matt dash 2014년 12월 10일
Hello everybody,
I'm simulating the behavior of the particle in a flow. I want to plot my particles uning plot(x,y,'o') and I want that the radius of the o is the radius of the particle.
Can you help me? Thanks, Luca

답변 (2개)

Star Strider
Star Strider 2014년 12월 10일
See Specify Line Width, Marker Size, and Marker Color in the documentation for plot to change the size of the marker (the 'o' in your plot call).
  댓글 수: 2
Luca
Luca 2014년 12월 10일
I know how to use 'markersize', but I don't understand what means the size that I impose. I want to impose the diameter of the particles (of the 'o') in relationship with the axis.
Star Strider
Star Strider 2014년 12월 10일
The default units for markers, lines, and other such are ‘points’ (1 pt = 0.35278 mm). (In R2014b this is fixed, but in previous versions it was possible to specify different units, if I remember correctly.) You can specify the units in Figure Properties, so that would probably carry over to the size units of your markers, but I haven’t experimented with that so I can’t say for sure.
You may have to do your plotting in a loop using the hold function, plotting each point individually in each iteration and changing the marker size individually according to the relation you define. I doubt there is any other way to do it.

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


matt dash
matt dash 2014년 12월 10일
The plot markers really arent intended to function with that level of precision. The best way to accomplish what you want is to create circular patches, or use the rectangle function and set the roundness to make it a circle. Only these options ensure that your marker radius stays correct if e.g. your axis limits change or are zoomed.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by