Turning the visibility inside a function does not work?
1 回表示 (過去 30 日間)
古いコメントを表示
I have this simple code :
a = lab(:,2);
b = lab(:,3);
L = lab(:,1);
k = boundary(a,b,L);
sRGBGamut = trisurf(k,a,b,L,'FaceColor','interp', 'FaceVertexCData',rgb,'EdgeColor','none');
set(sRGBGamut, 'Visible', 'off'); %<<<<<<<<<<<<<<<<<<<<<< see this line of code?
xlabel('a*')
ylabel('b*')
zlabel('L*')
axis([-128 128 -128 128 0 100])
view(10,35)
axis equal
title('sRGB gamut surface', 'in L*a*b* space'); % Add Title to Current Axes
ax.TitleHorizontalAlignment = 'left';
As you see, there is no point turning the visibility of the plot off here, but, for the sake of testing, it works. But for some reason, it refuses to work when issued from within a callback function. See this code :
function popupCallback(popup,event)
sels = get(popup,'String');
idx = get(popup,'Value');
Choix = sels{idx};
global sRGBGamut;
switch(Choix)
case 'sRGB'
title('sRGB gamut surface', 'in L*a*b* space');
set(sRGBGamut, 'Visible', 'on');
fprintf('sRGB\n' );
case 'AdobeRGB'
title('AdobeRGB gamut surface', 'in L*a*b* space');
set(sRGBGamut, 'Visible', 'off');
fprintf('AdobeRGB\n' );
case 'P3'
title('Display P3 gamut surface', 'in L*a*b* space');
set(sRGBGamut, 'Visible', 'off');
fprintf('P3\n' );
case 'Rec2020'
title('Rec2020 gamut surface', 'in L*a*b* space');
set(sRGBGamut, 'Visible', 'off');
fprintf('Rec2020\n' );
%otherwise
% fprintf('Invalid grade\n' );
end
end
What baffles me is that changing the title works great. But not turning the visibility of the plot?
3 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!