plotting wave heights next to dots on a matlab plot
2 次查看(过去 30 天)
显示 更早的评论
“wavedata” is a 1X50 structure array, and each element is a field with a title and a value. (name, id, time, temperature, waveheight, lat, lon). I already plot the lat and long of the locations from the wavedata structure array as follows:
Latpos=[wavedata(1,:).lat];
Lonpos=[wavedata(1,:).lon];
plot(Lonpos,Latpos, ‘.’);
Now, how do I plot the wave height next to the dots on the plot so that it shows the dot and the wave height next to it?
The problem then becomes: since there are multiple wave heights over a 24 hour period, how do I make a scoll bar on the plot that allows me to scroll from time A to time B according to what time it was. (Then the wave height at each dot would change accordingly?)
Any help would be greatly appreciated. This is for my job not for school work.
5 个评论
dpb
2014-7-8
You can add a slider uicontrol to do the height variability it would seem?
doc uicontrol % example given for callback for a z-axis scaling
回答(1 个)
dpb
2014-7-1
You might look at
doc scatter
As for the labelling,
text(xx,y+dy,num2str(height,'%.2f'),'horizontal','center','vertical','lower')
will write the height values at x,y w/ a slight offset dy for the y direction to not place it directly on the point. Salt to suit...
I don't know how to build an automagic figure axis slider, sorry; I don't do GUIs. Maybe somebody else will chime in on that part.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!