When I do shading interp for pcolor on App Designer the graph becomes blank.
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Whenever I try to change the shading or facecolor on my pcolor graph in App Designer the chart disappears and I get an error message.
The graph works when I don't try to change the shading or orientation.
pcolor(app.UIAxes,XPositions,YPositions,Temperature)
app.UIAxes.FaceColor = 'interp';
% Unrecognized property 'FaceColor' for class 'matlab.ui.control.UIAxes'.
%% It also doesn't recognize 'shading'
I also tried to use imagesc but I can't get the y-direction to flip or shading to interp.
set (app.UIAxes, gca,'YDir','normal')
% Error using matlab.ui.control.UIAxes/set
% Invalid parameter/value pair arguments.
Is this just not something that is possible on App Designer?
1 commentaire
Adi Purwandana
le 22 Fév 2023
Try to use FaceColor 'flat'
h1 = pcolor(app.UIAxes,longn,latn,log10(Epsgrid_a_50'));
h1.FaceColor = 'flat';
colormap(app.UIAxes,jet(6))
colorbar(app.UIAxes);
Réponse acceptée
Voss
le 2 Juin 2022
% Unrecognized property 'FaceColor' for class 'matlab.ui.control.UIAxes'.
This error happens because FaceColor is not a uiaxes (or axes) property. It is a surface property, which is what is created by pcolor, so try this:
my_surface = pcolor(app.UIAxes,XPositions,YPositions,Temperature);
my_surface.FaceColor = 'interp';
"I also tried to use imagesc but I can't get the y-direction to flip"
Try this:
set(app.UIAxes,'YDir','normal');
(gca is the current axes; app.UIAxes is your uiaxes; it's not correct to use both.)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!