Link Geoplot zoom to subplots

17 次查看(过去 30 天)
Dom
Dom 2021-11-7
回答: Adam Danz 2021-11-7
Hi,
this might be quie a tricky one. I got a geoplot showing a car route that consists of separate route elements(one segment between two gps points). I got a second plot, that plots the speed limit over the length of each route segment.
To insecpt a specific part of the route I want to connect the geoplot zoom to the speed limit plot-zoom. I therefore want to zoom into the speed limit plot so that it only show the speed limit of the visivle sections inside the (magnified) geplot.
My idea was to detect the visible sections in the zoomed geoplot and then adjust the x-axis of the speed plot accordingly. But I can't think of a function that would be able to do that. Do you have an alternative idea?
Thank you in advance!

回答(1 个)

Adam Danz
Adam Danz 2021-11-7
Yes, this is complicated.
The goal would be to link the axis limits (linaxes) but ...
  1. Latitude in non-linear in geoaxes
  2. The actual limits chosen by geolimits are greater in extent than the requested limits.
This is explained and demonstrated in this answer.
One workaround is to use map axes instead of geoaxes.
Another workaround would be convert your speed data to geo units and plot the data on geoaxes so you can scale the axis limits using the same scale between the two plots.
Here is an answer that address a similar problem and achieve linked zooming for geo data and non-geo data
Here is an answer that assigns a listener to the geoaxes that responds to changes to the geoaxes
This comment may also be helpful to transform between map and geo axes

类别

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

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by