Can I create a custom markersize for plotting?

1 回表示 (過去 30 日間)
Sean Farrell
Sean Farrell 2017 年 1 月 14 日
コメント済み: tuo 2020 年 4 月 23 日
Hi everyone. I am working on plotting a distribution of points. I need to plot custom sized points, however. Specifically, I have an image that I uploaded into MatLab, and on the image, there is a scale which represents 200 nanometers. From this scale and the imtool function, I can find how many pixels are in the 200 nanometers. With more calculations (I won't mention them), I can find how many pixels are in a particle that is 15 nanometers, in my case 7 pixels! Now, I want to plot these particles onto the image, with the corresponding diameter in pixels. So, instead of just doing ('MarkerSize',10), can I somehow plot points with a specified dimension?
Much appreciated!

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 1 月 14 日
If you are drawing lines, then you can only have one marker size for any given line object. The marker size is in points.
If you use scatter() then you can provide a vector of sizes, so as to give a different size for each marker. The marker size is in points. The documentation for scatter specifically indicates that it is the area that you give, so if you want a particular diameter, d, use pi*(d/2)^2
  2 件のコメント
Sean Farrell
Sean Farrell 2017 年 1 月 14 日
Thank you! This should do the trick!
Best, Sean
tuo
tuo 2020 年 4 月 23 日
can you give me an example? it is better to understand

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by