When I do shading interp for pcolor on App Designer the graph becomes blank.
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Joseph Lesniak
am 2 Jun. 2022
Kommentiert: Adi Purwandana
am 22 Feb. 2023
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 Kommentar
Adi Purwandana
am 22 Feb. 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);
Akzeptierte Antwort
Voss
am 2 Jun. 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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!