フィルターのクリア

Unable to change Marker Size in Scatter Plot

145 ビュー (過去 30 日間)
Ed
Ed 2022 年 12 月 14 日
コメント済み: Ed 2022 年 12 月 15 日
Hi, I imported a .csv file into MATLAB, auto-generated code, and clicked the icon to create a scatter plot. The screens are shown in the first three attachments (mat1, mat2, mat3). The problem I am having is that I want to change the size of the Markers in the plot to a smaller size. I cannot do that.
Here is what I tried : On the plot menu, I selected "File --> Generate Code". I got the fourth attached screen print (mat4). I know that I can change the marker size to (say 5) by changing the command: scatter(X1,Y1); to scatter(X1,Y1,5); so I made that change in the code. Then I selected the scatter plot option at the top of the screen. However, the markers did not change in the resulting plot. They were the same size. Please tell me what I am doing wrong, and how to do this correctly. Thank you!
  2 件のコメント
VBBV
VBBV 2022 年 12 月 15 日
編集済み: VBBV 2022 年 12 月 15 日
If you want to change the Markersize in scatter plot, you need to navigate to property editor by selecting View -> Property Editor. Then select the marker in the plot, then you will be able to see a new box beneath the plot where you can edit size value for Marker. After entering new value, click on the Refresh Data button to the right, you can then see the changes.
when you change the Markersize of the scatter function call in your code, you need to run the script again in order to see the effect of markersize in plot.
Ed
Ed 2022 年 12 月 15 日
Thank you. That worked great.
Ed

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

採用された回答

Walter Roberson
Walter Roberson 2022 年 12 月 15 日
When you choose the scatter plot option at the top of the screen, that executes a new call to scatter() with appropriate parameters; it does not execute the code in createfigure.
You should be using
createfigure(extent.VarName1, extent.VarName2)

その他の回答 (1 件)

Bora Eryilmaz
Bora Eryilmaz 2022 年 12 月 14 日
編集済み: Bora Eryilmaz 2022 年 12 月 14 日
You just need to pick a good value:
x = rand(10,1);
y = rand(10,1);
subplot(211)
scatter(x,y)
subplot(212)
scatter(x,y,100)
The default is equivalent to sz = 36.

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by