0
我想在顏色欄上創建第二個標尺,但是標記的值已關閉,例如0.2應爲14.33,0.4應爲13.57等等。MATLAB - 色標的第二個標尺關閉
這是代碼的相關位:在我看來
hFig = figure('Name','False Color Luminance Map', 'ToolBar','none', 'MenuBar','none');
% Create/initialize default colormap of jet.
cmap = parula(16); % or 256, 64, 32 or whatever.
% Now make lowest values show up as black.
cmap(1,:) = 0;
% Now make highest values show up as white.
cmap(end,:) = 1;
imshow(J,'Colormap',cmap) % show Image in false color
colorbar % add colorbar
h = colorbar; % define colorbar as variable
caxis auto
y_Scl = (1/C);
yticks = get(h,'YTick');
set(h,'YTickLabel',sprintfc('%g', [yticks.*y_Scl]))
ylabel(h, 'cd/m^2')% add unit label
BarPos = get(h,'position');
haxes = axes('position',BarPos,'color','none','ylim',[0 150]);
set(haxes,'YTickLabel', sprintfc('%g', log10(yticks.*y_Scl/108000)/-0.4));
錯誤有在最後兩行是什麼地方。
編輯: 當我改變 haxes =軸( '位置',BarPos, '顏色', '無', 'ylim',[0 150]); haxes = axes('position',BarPos,'color','none','ylim',[0 150]); 我得到這個 所有正確的值在那裏,但沒有正確對齊!