Saving Geoplots to non-.fig files

조회 수: 5 (최근 30일)
Alan
Alan 2024년 12월 17일
답변: Ruchika Parag 2025년 1월 6일
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

답변 (1개)

Ruchika Parag
Ruchika Parag 2025년 1월 6일
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!

카테고리

Help CenterFile Exchange에서 Geographic Plots에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by