How to make an interactive plot that would show timeseries data on a spatial map?

I would like to make an interactive plot in such a way that it has the desired spatial points on a lat-long plot and upon clicking a point on the lat-long space using the mouse it would show the timeseries data of a variable at that particular point. I can, of course, plot the spatial points and the timeseries but I am having trouble finding ways to connect the two plots into one.
P.S. - I realize a simple animation would be an easier way but I do not want to do that.

Antworten (1)

[X,Y,Z] = peaks(100) ;
h1 = figure(1) ;
subplot(211)
pcolor(X,Y,Z) ;
shading interp
while true
[x,y] = getpts(h1) ;
% Do interpolation/ selection get the time series for x,y
subplot(212)
plot(rand(100,1)) ;
title(sprintf('x = %f,y=%f',x,y))
end

2 Kommentare

Great answer man! But getpts only works if you have the Image Processing toolbox which I don't :(
Do you any alternatives?
Have a look on ginput

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Exploration finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 8 Nov. 2018

Kommentiert:

am 8 Nov. 2018

Community Treasure Hunt

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

Start Hunting!

Translated by