0

カラーバーのサイズを変更せずに 3D パッチを拡大することは可能ですか? 私の元の写真は次のようなものです。

ここに画像の説明を入力

カラーバーを変更せずに、図の中央にあるブロックを拡大したいだけです。以前はzoom(1.9)を使っていたので良かったのですが、forループを使ってシーケンシャルファイルを読み込んで別のグラフをプロットして動画にする必要があるので、グラフがどんどん大きくなってしまったので、プロットを拡大するには別の方法が必要なようです.

更新:私のコード

set(gcf,'Renderer','zbuffer'); %eliminate unnecessary background and prevent stationary video - Important!
vid = VideoWriter('afation.avi'); %Create a avi file 
vid.Quality = 100;
vid.FrameRate = 15;
open(vid); %Open the avi file so that films can be put into it later on

for ii=FirstFile:FileInterval:LastFile  

fid = fopen(filename,'r');
datacell = textscan(fid, '%f%f%f%f%f%f%f%f'); %There are 8 columns to be read so there are 8 %f
fclose(fid);

all_data = cell2mat(datacell); %converted into a matrix containing all the dis. density info. for every simulation cell

M=zeros(NumBoxX,NumBoxY,NumBoxZ); %create a matrix of 50x50x5,representing array of simulation cells
% % the following loops assign the dislocation density from all_data to M
for i=1:NumBoxX            
    for j=1:NumBoxY        
        for k=1:NumBoxZ     
            num=k+NumBoxZ*(j-1)+NumBoxZ*NumBoxY*(i-1);
            M(i,j,k)=all_data(num,ValCol); %the ValCol column of all_data is dislocation density 
        end
    end
end

indPatch=1:numel(M);
[F,V,C]=ind2patch(indPatch,M,'v'); %Call the function ind2patch in order to plot 3D cube with color

title('AA in different cells','fontsize',20);%set title \sigma_{xx}
xlabel('y','fontsize',20);ylabel('x','fontsize',20); zlabel('z','fontsize',20); hold on;
set(get(gca,'xlabel'),'Position',[5 -50 30]); %set position of axis label
set(get(gca,'ylabel'),'Position',[5 50 -15]);
set(get(gca,'zlabel'),'Position',[64 190 -60]);
patch('Faces',F,'Vertices',V,'FaceColor','flat','CData',C,'EdgeColor','k','FaceAlpha',0.5);
axis equal; view(3); axis tight; axis vis3d; grid off;
colormap(cMap);
caxis([MinDis MaxDis]); %set the range of the colorbar   %caxis([min(M(:)) max(M(:))]); %range of the colorbar according to one file only
cb = colorbar;     % create the colorbar
set(get(cb,'title'),'string','aaty(m^{-2})','fontsize',20); 

lbpos = get(cb,'title'); % get the handle of the colorbar title
set(lbpos,'units','normalized','position',[0,1.04]);
MyAxes=gca;
set(MyAxes,'Units','Normalized','position',[0.05,0.1,0.8,0.8]);

zoom(1.9);
writeVideo(vid, getframe(gcf)); %get the picture and put in the avi file with the handle "vid"

end

close(vid); %close the avi file after putting all the films into it
% winopen('ggggon.avi'); %play the movie

画像を1つずつ拡大してaviファイルに入れてムービーを作成する必要があるため、forループにズームを入れました。

4

0 に答える 0