Two figures have different sizes when plotted using contourf and colorbar
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (1)
Kristin Busa
il 13 Mag 2014
Categorie
Scopri di più su Contour Plots in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!