change mouse hover datatip information?

15 次查看(过去 30 天)
I have created geoscatter of vehicle speed. When hovering over datapoints on map, datatips show Latitude and Longlitude. How can I change this to show speed?
my code is:
geoscatter(GPSData.latitude, GPSData.longitude, 100, GPSData.speed,'filled');
colormap jet
caxis([0 120]);

采纳的回答

Anton Kogios
Anton Kogios 2024-3-3
Since I don't have your GPSData data, here's a working example of how to do it using dataTipTextRow. See also Create Custom Data Tips and DataTipTemplate Properties.
lat = [32.30 33.92 35.17 36.98 37.69 38.34];
lon = [-91.05 -91.18 -90.09 -89.11 -89.52 -90.37];
A = 100*[5 12 15 3 10 3];
C = [1 2 2 3 1 1];
g = geoscatter(lat,lon,A,C,"filled");
g.DataTipTemplate.DataTipRows = dataTipTextRow('Speed',C,'auto');
Otherwise you can also edit individual data tips using:
g.DataTipTemplate.DataTipRows(1).Label = 'Speed';
g.DataTipTemplate.DataTipRows(1).Value = 'SizeData';
g.DataTipTemplate.DataTipRows(1).Format = 'auto';

更多回答(0 个)

类别

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

产品

Community Treasure Hunt

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

Start Hunting!

Translated by