Turning the visibility inside a function does not work?
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Lighting, Transparency, and Shading in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!