Creating movies from surface maps

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

답변 (2개)

Image Analyst
Image Analyst 2011년 12월 13일

0 개 추천

댓글 수: 6

Jorge Ramirez
Jorge Ramirez 2011년 12월 13일
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 2011년 12월 13일
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 2011년 12월 13일
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 2011년 12월 13일
Have you tried using frame2im?
Sean de Wolski
Sean de Wolski 2011년 12월 13일
What are sample lat/lon/Vul_P values we could use to replicate what you have?
Jorge Ramirez
Jorge Ramirez 2011년 12월 13일
A sample dataset and simple code reproducing my problem can be downloaded from:
http://www.engr.colostate.edu/~ramirez/MovieQuestion.zip
Thank you.

댓글을 달려면 로그인하십시오.

Sean de Wolski
Sean de Wolski 2011년 12월 13일

0 개 추천

  • 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);

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

질문:

2011년 12월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by