How to make scatter plots change size after certain value range
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Lukas Samuelsen
il 6 Ago 2020
Commentato: Lukas Samuelsen
il 14 Ago 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 Commenti
Risposta accettata
Uday Pradhan
il 12 Ago 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.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Scatter Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!