Using contourfcmap in Matlabs App Designer:
이전 댓글 표시
Hello!
I really like the benefits of contourfcmap (Matlab Exchange) over contourf and would like to use it in Matlabs App Designer.
Unfortunately contourfcmap doesn't support the format Matlabs App Designer is using for plotting.
I need to specifically adress app.UIAxes.
works: contourf(app.UIAxes, X, Y, Z, 10)
doesn't work: contourfcmap(app.UIAxes, X, Y, Z, 10)
Is there a quick way to make contourfcmap useable for Matlabs App Designer or any workaround?
Thanks a lot in advance!
Kind Regards,
Steve
Testapp (Push button to Plot in app.UIAxes)
function ButtonPushed(app, event)
% Callback function for PlotButton
x = linspace(-2, 2, 100);
y = linspace(-2, 2, 100);
[X, Y] = meshgrid(x, y);
Z = exp(-X.^2 - Y.^2);
contour_levels = linspace(min(Z(:)), max(Z(:)), 10);
cmap = jet(length(contour_levels)-1);
cmap_lowest = [0 0 1];
cmap_highest = [1 0 0];
hc = contourfcmap_app(app.UIAxes, x, y, Z, contour_levels, cmap, ...
'lo', cmap_lowest, ...
'hi', cmap_highest, ...
'cbarloc', 'eastoutside', ...
'method', 'calccontour');
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Color and Styling에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!