How to make scatter plots change size after certain value range

4 次查看(过去 30 天)
Hey, I need help with some matlab.
Had made a Matlab script over precipitation data as well as tree locations and now having the problem with my last infromation (tree thickness) which needed to be implemented with the other data in a 2D map function.
Cant seem to make it work so the points, which shows tree locations, change size depending on the thickness of each tree. So its like a second scale in the 2D map. Have uploaded the script and the information that needs to be included.
(just ignore the green texts, just notes for me in danish because just started learning the program)
Hope you guys can help me ^^

采纳的回答

Uday Pradhan
Uday Pradhan 2020-8-12
Hi Lukas,
In my understanding, you want to plot a scatter plot of the locations of trees from their text data files such that the size of the scattered points varies according to the thickness of the trees.
This can be done using the “scatter” plot function as it can plot points with varying sizes if a third vector of scalar values is provided which has the same number of elements as the vectors being plotted. I have assumed that the location and thickness information of the trees is given in the file “TreeAndSize_data_SiteA.txt”. With this assumption, we can get the required plot as follows:
fil = load('TreeAndSize_data_SiteA.txt');
scatter(fil(:,1),fil(:,2),fil(:,3) * k,'filled');
% Assuming that the first, second and third columns are locations and thickness respectively.
% Vary "k” to get different point scales.
For more options, please refer to the scatter plot documentation.
  1 个评论
Lukas Samuelsen
Lukas Samuelsen 2020-8-14
Thanks for help ^^
I dont know why i couldnt make it work when it was so simple to do. Guess that i got lost when trying all kind of methods.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by