Two figures have different sizes when plotted using contourf and colorbar
古いコメントを表示
Hello,
I am using contourf to plot two different figures. Below is sample code which runs using the .mat file attached.
clear all; close all; clc;
load contourfproblemdata.mat;
figure1 = figure('Position',[400 300 300 300]);
contourf(X,Y,data1,50,'linestyle','none'); axis equal; hold all;
colormap gray; xlim([-100 100]); ylim([-100 100]);
colorbar;
figure2 = figure('Position',[400 300 300 300]);
contourf(X,Y,data2,50,'linestyle','none'); axis equal; hold all;
colormap gray; xlim([-100 100]); ylim([-100 100]);
colorbar;
If you flip back and forth between figure1 and figure2, you'll see that the plots shift slightly, and that the colorbar on figure2 is partially obscured (the black border is somewhat missing from the left side of the colorbar).
Any help would be much appreciated!
Thanks, Kristin
採用された回答
その他の回答 (1 件)
Kristin Busa
2014 年 5 月 13 日
カテゴリ
ヘルプ センター および File Exchange で Contour Plots についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!