TextScatter implementation does not expose the indices it chose for display when ‘TextDensityPercentage’ is used
rng(10) % for reproducibility
n=100;
x = randn(n,1);
y = randn(n,1);
seq = (1:n)’;
h=textscatter(x,y,string(seq), …
‘TextDensityPercentage’,20, …
‘DisplayName’,’text’)
I want to know the indexes of the unis which have been displayed by function textscatter from handle h (in this case 1, 4 and 22) or from findall, ancestor, ….
I wanted to use textscatter with geoaxes but it seems it is not supported. Therefore the idea is to project the map on cartesian axes and then retrieve the indexes of displayed units from textscatter with ‘Name’, Value ‘TextDensityPercentage’,20, but I need to know the indexes.
Any other idea is welcome (apart from "implementing my own label-selection rule" which labels points if they are not closer than a threshold) .
Copilot and ChatGPT claim it is not possible but I want to have your opinion.
Thank you in advancerng(10) % for reproducibility
n=100;
x = randn(n,1);
y = randn(n,1);
seq = (1:n)’;
h=textscatter(x,y,string(seq), …
‘TextDensityPercentage’,20, …
‘DisplayName’,’text’)
I want to know the indexes of the unis which have been displayed by function textscatter from handle h (in this case 1, 4 and 22) or from findall, ancestor, ….
I wanted to use textscatter with geoaxes but it seems it is not supported. Therefore the idea is to project the map on cartesian axes and then retrieve the indexes of displayed units from textscatter with ‘Name’, Value ‘TextDensityPercentage’,20, but I need to know the indexes.
Any other idea is welcome (apart from "implementing my own label-selection rule" which labels points if they are not closer than a threshold) .
Copilot and ChatGPT claim it is not possible but I want to have your opinion.
Thank you in advance rng(10) % for reproducibility
n=100;
x = randn(n,1);
y = randn(n,1);
seq = (1:n)’;
h=textscatter(x,y,string(seq), …
‘TextDensityPercentage’,20, …
‘DisplayName’,’text’)
I want to know the indexes of the unis which have been displayed by function textscatter from handle h (in this case 1, 4 and 22) or from findall, ancestor, ….
I wanted to use textscatter with geoaxes but it seems it is not supported. Therefore the idea is to project the map on cartesian axes and then retrieve the indexes of displayed units from textscatter with ‘Name’, Value ‘TextDensityPercentage’,20, but I need to know the indexes.
Any other idea is welcome (apart from "implementing my own label-selection rule" which labels points if they are not closer than a threshold) .
Copilot and ChatGPT claim it is not possible but I want to have your opinion.
Thank you in advance textscatter MATLAB Answers — New Questions









