Saving Geoplots to non-.fig files

2 visualizzazioni (ultimi 30 giorni)
Alan
Alan il 17 Dic 2024
Risposto: Ruchika Parag il 6 Gen 2025
Hello,
I have a figure on a geoplot. The figure contains data over a wide area and I need to be able to zoom into smaller regions to see the details. I would like to save this in a format that is not a .fig file that still maintains the ability to zoom in like on a .fig file. I've looked into saving as a kml file, but I want this figure to be easily accessible and doesn't need special software to read. Is there any way to do this easily or will I just need to take many pdf/svg shots and splice them together?
Thanks

Risposte (1)

Ruchika Parag
Ruchika Parag il 6 Gen 2025
Hi @Alan, you can create an interactive map using MATLAB's native capabilities, such as exporting to a web-friendly format that supports interactivity. One option is to use the 'webmap' feature, which allows you to interact with geographic data in a web browser-like environment.
Here is a workaround:
  1. Use 'webmap' for Interactive Viewing:
  • 'webmap' allows you to display geographic data interactively within MATLAB. Although it doesn't export to an HTML file, it's useful for exploring data.
% Example code:
lat = [37.7749, 34.0522, 40.7128]; % Example latitudes
lon = [-122.4194, -118.2437, -74.0060]; % Example longitudes
% Create a Web Map
wm = webmap('OpenStreetMap');
wmmarker(lat, lon, 'FeatureName', {'San Francisco', 'Los Angeles', 'New York'});
2. Export Static Images for Documentation:
  • If you need to share your map outside of MATLAB, consider exporting static images at different zoom levels. While this doesn't provide interactivity, it allows you to document specific views.
% Save a static image of the current geoplot
frame = getframe(gcf);
imwrite(frame.cdata, 'geoplot_image.png');
I hope these approaches can help you explore and share geographic data!

Categorie

Scopri di più su Geographic Plots in Help Center e File Exchange

Prodotti


Release

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by