How to make scatter plots change size after certain value range
4 views (last 30 days)
Show older comments
Lukas Samuelsen
on 6 Aug 2020
Commented: Lukas Samuelsen
on 14 Aug 2020
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 ^^
0 Comments
Accepted Answer
Uday Pradhan
on 12 Aug 2020
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.
More Answers (0)
See Also
Categories
Find more on Scatter Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!