Issue
The MATLAB code I wrote is:
FigHandle = figure;
set(FigHandle, 'Position', [0, 0, 1060, 140]);
load('velocity0.dat')
v=reshape(velocity0,106,14)
vt=transpose(v)
pim=imagesc(vt) ;
set(gca,'XTickLabel',{'1','2','3','4','5','6','7','8','9','10'}, 'FontSize',11)
set(gca,'YTickLabel',{'0.15','0.35','0.55','0.75','0.95','1.15','1.35'}, 'FontSize',11)
xlabel('distance(km)')
ylabel('depth(km)')
C = colorbar('location','EastOutside');
caxis([2928,5553])
set(get(C,'XLabel'),'String','velocity(m/s)', 'FontSize',11)
I am trying to finish my paper for a scientific journal. The reviewers have asked for new images. However, I have not worked with the code for more than a year and I do not have MATLAB installed at my new job. As such, I asked my friend and got this image below.
Previously, the image looked like this in the past:
Should I change the code to get desired colors? Is this a colorbar issue?
Solution
Your friend is using R2014b or later where the default colour map is the parula colour map. The results you have previously are using the default colour map before R2014b, which is the jet colour map. As mentioned in the documentation regarding the default colour map:
colormap default
uses the default colormap, which is theparula
colormap with 64 colors. Versions of MATLAB® prior to R2014b usejet
as the default.
Therefore if you want to display results in this colour map in versions of MATLAB that are R2014b or later, simply calling:
colormap jet;
... at the very end of your code will solve your problem. However, don't be tripped out with the colours. What you're concerned about is whether your data follows the distribution of the colour bar on the right. The colours are primarily just for visual display.
Answered By - rayryeng Answer Checked By - Cary Denson (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.