From: Eric on 27 Apr 2010 15:35 Hi everyone- I am making an animation out of several .asc files that represent snowcover. In the plots/animation I would like to not have the the zero values (no snow cover) as no color. I have tried excludedata, but am getting no where. I have tried replacing all 0.00 with NaN, but that does not seem to work.?. h2 = subplot(212); set(h2,'position',[0.13 0.11 0.775 0.6]) imagesc(swe,[0 4]) % this sets the range of snow depth from 0 to 4 colormap('winter') colorbar('EastOutside') axis('equal') Thanks for your help- Eric
From: sprolese on 29 Apr 2010 17:07 "Eric " <sprolese(a)lanecc.edu> wrote in message <hr7e9b$m0u$1(a)fred.mathworks.com>... > Hi everyone- > > I am making an animation out of several .asc files that represent snowcover. In the plots/animation I would like to not have the the zero values (no snow cover) as no color. I have tried excludedata, but am getting no where. > > I have tried replacing all 0.00 with NaN, but that does not seem to work.?. > > h2 = subplot(212); > set(h2,'position',[0.13 0.11 0.775 0.6]) > imagesc(swe,[0 4]) % this sets the range of snow depth from 0 to 4 > colormap('winter') > colorbar('EastOutside') > axis('equal') > > Thanks for your help- > Eric so I found the answer from this link: http://clipmarks.com/clipmark/EA9157A0-E584-4044-BB44-0BC71013F1A9/ here is the way my file worked to get the .asc to create one frame with nan as no color <<--Begin Code -->> filename = ['swe_depth_2002.05.30.00.asc']; swe_zero = textread(filename,'',-1,'headerlines',6); swe_zero(swe_zero == 0)=nan; z=swe_zero; z(isnan(swe_zero))=0; z(~isnan(swe_zero))=1; colormap(mycmap); imagesc(swe_zero); colorbar; set(gca,'color',[1 1 1]); alpha(z); axis image; [iy,ix]=find(a==amax); line(ix,iy,'marker','o',... 'markerfacecolor',[0 0 0],... 'markeredgecolor',[0 0 0]); <<--End Code -->>
From: us on 29 Apr 2010 17:25 "Eric " <sprolese(a)lanecc.edu> wrote in message <hr7e9b$m0u$1(a)fred.mathworks.com>... > Hi everyone- > > I am making an animation out of several .asc files that represent snowcover. In the plots/animation I would like to not have the the zero values (no snow cover) as no color. I have tried excludedata, but am getting no where. > > I have tried replacing all 0.00 with NaN, but that does not seem to work.?. > > h2 = subplot(212); > set(h2,'position',[0.13 0.11 0.775 0.6]) > imagesc(swe,[0 4]) % this sets the range of snow depth from 0 to 4 > colormap('winter') > colorbar('EastOutside') > axis('equal') > > Thanks for your help- > Eric one of the many solutions m=magic(16); m(m<128)=nan; imagesc(m); axis image; colormap(hot(129)); colorbar; alpha(double((~isnan(m)))); us
|
Pages: 1 Prev: Matlab crashes on image/surf Next: kmeans centroid with correlation |