change mouse hover datatip information?
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sven Larsen
el 3 de Mzo. de 2024
Comentada: Sven Larsen
el 3 de Mzo. de 2024
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]);
0 comentarios
Respuesta aceptada
Anton Kogios
el 3 de Mzo. de 2024
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';
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Distribution Plots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!