Get clim values from colormap and adjust them in real time
Show older comments
I am trying to get the cmin and cmax values from a colormap, output them to editfields and let the user change them to update the plot in real time.
s = trisurf(F,P(:,1),P(:,2),P(:,3), Thickness2, 'Parent', app.UIAxes2_5);
c = colorbar(app.UIAxes2_5);
d = colormap(app.UIAxes2_5, jet);
d.clim([cmin cmax]); %Error: unrecognized function or variable 'cmin'
app.MinEditField.Enable = 'on';
app.MinEditField.Value = cmin;
app.MaxEditField.Enable = 'on';
app.MaxEditField.Value = cmax;
I also want the faceAlpha to be 0 for values above cmax and below cmin. But before I reach there, I get an error.
Accepted Answer
More Answers (1)
Simon Chan
on 11 Mar 2022
0 votes
Use clim(app.UIAxes2_5,[cmin cmax])
1 Comment
Pelajar UM
on 11 Mar 2022
Categories
Find more on Color and Styling 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!