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!