Get clim values from colormap and adjust them in real time
26 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Pelajar UM
el 11 de Mzo. de 2022
Comentada: Pelajar UM
el 11 de Mzo. de 2022
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.
0 comentarios
Respuesta aceptada
Sugar Daddy
el 11 de Mzo. de 2022
boyaa, let me show you how to do that in a simple matlab figure. then figure it out yourself, how to do it for uiaxes
ax = gca;
mesh(ax,rand(100,100));
colormap(ax,'jet')
[cmin cmax] = deal(ax.CLim);
Now you have current cmin and cmax value.
change their value in Clim
ax.CLim = [0.1 1]
Más respuestas (1)
Ver también
Categorías
Más información sobre Blue en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!