필터 지우기
필터 지우기

Editing a Colormap in MATLAB

조회 수: 7 (최근 30일)
martin martin
martin martin 2019년 4월 19일
댓글: Cris LaPierre 2022년 4월 14일
Hello guys,
I have seen video about edit a colormap https://www.mathworks.com/videos/interactively-editing-a-colormap-in-matlab-97147.html , but i don't know, how to save the setting after I edit values. Specific example ... I edit map on the top with the cursor of mouse (move positive and negative values to the center - zero). How can I get this setting always?
askcolormap.PNG

채택된 답변

Cris LaPierre
Cris LaPierre 2019년 4월 20일
My suggestion would be to create an image, set it as you want, save the colormap and color axis limits to a mat file.
cmap = colormap(gca);
cl = caxis;
save cmap.mat cmap cl
Then, when you want to use the same colormap, load the mat file, and set the colormap and color axis limits to the values loaded in the mat file.
load cmap
contourf(X,Y,z)
colormap(cmap);
colorbar
caxis(cl);
  댓글 수: 3
Supriya Gain
Supriya Gain 2022년 4월 13일
For me it didn't work. I'm not able to save the .mat file. It showing some error like,"unable to write the file cmap.mat: permission denied"
Cris LaPierre
Cris LaPierre 2022년 4월 14일
You appear to be trying to save the file to a location you do not have write permission. Try changing your current folder location.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by