Creating movies from surface maps

How can I create movies from figures produced with "surfacem" of the Maping Toolbox?
Thank you.

Réponses (2)

Image Analyst
Image Analyst le 13 Déc 2011

0 votes

6 commentaires

Jorge Ramirez
Jorge Ramirez le 13 Déc 2011
Dear Image Analyst,
thank you very much for your answer. However, the question was not about how to create movies in general, which I can do without problem. The question was about how to create movies from images produced using "surfacem" of the Mapping Toolbox. I either end up with a movie with a white rectangular background containing an extra x-y axis and my movie is superposed on that set of axes; other problems: if my surface map is large, the movie only shows a small section of the map, etc.
It appears that I need to do something extra to create the movies if the figures are from the Mapping Toolbox.
Once again, thank you for all your help.
Best regards,
Jorge
Oliver Woodford
Oliver Woodford le 13 Déc 2011
Since the suggested approaches both save the figure as an image at each frame, the problem must therefore be that your figure to image conversion is introducing the errors you describe. Perhaps you can improve your question to be more specific about this.
Jorge Ramirez
Jorge Ramirez le 13 Déc 2011
Dear Oliver,
below is a snippet of my code for your review. Again, thank you.
Jorge
scrsz = get(0,'ScreenSize');
states = shaperead('usastatehi', 'UseGeoCoords', true);
figure('Name','Vulnerability Analysis','Position',[scrsz(1) 0 scrsz(3) scrsz(4)]);
axesm ('eqaconic','MapLatLimit',[15 55],'MapLonLimit',[-130 -60]);
worldmap([24 51],[-126 -66]);
geoshow(states,'FaceColor',[1,1,1]);
geoshow('worldrivers.shp', 'Color', 'blue');
framem off
gridm on
caxis([0 1]);
h = gcf; surfacem(latitude,longitude,Vul_P,'CDataMapping','scaled');
xlabel('Longitude');ylabel('Latitude');
title({'Distribution Approach'});
colormap(mycolormap_3);
colorbar('location','EastOutside');
Md(i) = getframe(h);
hold on;
Sean de Wolski
Sean de Wolski le 13 Déc 2011
Have you tried using frame2im?
Sean de Wolski
Sean de Wolski le 13 Déc 2011
What are sample lat/lon/Vul_P values we could use to replicate what you have?
Jorge Ramirez
Jorge Ramirez le 13 Déc 2011
A sample dataset and simple code reproducing my problem can be downloaded from:
http://www.engr.colostate.edu/~ramirez/MovieQuestion.zip
Thank you.

Connectez-vous pour commenter.

Sean de Wolski
Sean de Wolski le 13 Déc 2011

0 votes

  • Force the figure to be a certain size with units pixels, put a set of axes onto it in a certain position. Then use the rectangle second input to getframe to extract just the part you want. (You could also just guess and check a few times to figure out the part you want.
  • To play the movie, set the various axes ticks to off so they don't show up, i.e:
figure;
axes;
set(gca,'xtick',[]);
set(gca,'ytick',[]);
movie(Md,5);

Catégories

En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by