![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/257660/image.png)
A more convenient colormapping
1 次查看(过去 30 天)
显示 更早的评论
![trial 4.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/257635/trial%204.jpeg)
The figure above is the change in transmission intensity over distance. But the colormapping scheme does not encapture the full picture. There is very gradual change around 0 (in the colorbar) that is absent from this picture.
I have edited the colormap through trial and error to get the foloowing picture:
![trial_colorcorrected.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/257636/trial_colorcorrected.jpeg)
It does capture the broadband phenomena around 800nm and 875nm. But such an image is not suitable for journal publication. How can I make it more sophisticated? TIA
The code and files are given below:
clc; clear all;
load zpos;
A=T';
l=l*1e9;z=z*1e9;
figure
p=pcolor(l,z,A*1e15);
colormap jet(500); % 500 levels of granularity
shading interp; % interpolate colors across lines and faces
xlim([750 900]);
ylim([-620 100]);
xlabel('wavelength (nm)') ;%ylabel('z (nm)');
xticks([750 775 800 825 850 875 900]);
yticks([-526 -326 -126 74]);
yticklabels({'z=200','z=0','z=-200','z=-400'})
% set(gca,'Units','normalized');
% set(gca,'TickLength',[0.5,0.5]);
%colorbar setting
c = colorbar;
%labels the colorbar vertically as desired
set(get(c,'label'),'string','Emission (a.u.)');
c.TickLength=.023;
c.Units='normalized';
c.FontSize=28;
%font properties
FS='Fontsize';
fs=20;
FN='Fontname';
fn='Times New Roman';
set(findall(gcf,'type','axes'),FS,fs,FN,fn);
set(findall(gcf,'type','text'),FS,fs,FN,fn);
0 个评论
采纳的回答
Adam Danz
2019-12-30
编辑:Adam Danz
2019-12-31
You could replace pcolor() with contourf(). The plot below uses 12 levels of contours. You can play around with the number of levels until you get the desired appearance.
contourf(l,z,A*1e15,12)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/257660/image.png)
2 个评论
Adam Danz
2019-12-31
You can also customize the border line width (set it to 0 for no line) and you can optionally set contour labels, too.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!