From: Xiang Qiu on 2 Mar 2010 00:08 I have four subplots with different scale. Say, one changes from 1 to 20, another one changes from 20 to 40. How can I use a single colorbar and colormap for all the subplots? Thanks.
From: Walter Roberson on 2 Mar 2010 00:32 Xiang Qiu wrote: > I have four subplots with different scale. Say, one changes from 1 to > 20, another one changes from 20 to 40. How can I use a single colorbar > and colormap for all the subplots? Thanks. You can't avoid using a single colormap for all of the subplots: there is only one colormap per figure. http://www.mathworks.com/support/tech-notes/1200/1215.html
From: Lorenzo Guerrasio on 2 Mar 2010 04:35 "Xiang Qiu" <xqiu(a)ece.ucsb.edu> wrote in message <hmi6fk$9n2$1(a)fred.mathworks.com>... > I have four subplots with different scale. Say, one changes from 1 to 20, another one changes from 20 to 40. How can I use a single colorbar and colormap for all the subplots? Thanks. If I got your point,you have just to set the clim property. Note,however,that you'll loose precision for the map where the z values vary the less. y=peaks(100).*5; z=peaks(100)*2+1; k=peaks(100)+10; x=peaks(100); minC=min([min(x(:)),min(y(:)),min(k(:)),min(z(:))]); maxC=max([max(x(:)),max(y(:)),max(k(:)),max(z(:))]); figure subplot(2,2,1),contourf(x),set(gca,'clim',[minC,maxC]); subplot(2,2,2),contourf(y),set(gca,'clim',[minC,maxC]); subplot(2,2,3),contourf(k),set(gca,'clim',[minC,maxC]); subplot(2,2,4),contourf(z),set(gca,'clim',[minC,maxC]);
|
Pages: 1 Prev: s-function builder Next: Accurate numerical differentiation in MATLAB? |