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!