Imprecise copying of axes

4 次查看(过去 30 天)
Tobias Fink
Tobias Fink 2020-9-7
Hello everyone,
I created an GUI via Code which shows me different figures depending on the input.
Since you can't save uifigures I then create a normal figure which takes all the data from the uifigure axis and save that.
The problem now is that while it works perfectly fine on the axis with a big range for the caxes, it looses a lot of data when the caxis is in a range from 0 to 1.
As you can see in the pictures below, the top one being the original from the uifigure and the bottom one being the copied version, the left plot looks the same even when zoomed in, while the right one clearly doesn't.
This is the code I'm using to copy the grey (Right) plot with the uifig.Children(i,1) being the uiaxes I want to copy from and ax1 the axes I want to copy into
XLim=xlim(uifig.Children(i,1));
YLim=ylim(uifig.Children(i,1));
dBLim=uifig.Children(i,1).CLim;
surface(ax1, uifig.Children(i,1).Children.XData, uifig.Children(i,1).Children.YData, uifig.Children(i,1).Children.ZData);
shading(ax1, 'interp');
xlabel(ax1, uifig.Children(i,1).XLabel.String);
ylabel(ax1, uifig.Children(i,1).YLabel.String);
set(ax1,'Layer','top');
set(ax1,'YDir','normal');
set(ax1,'Box','on');
set(ax1,'XMinorTick','on');
set(ax1,'YMinorTick','on');
colormap(ax1, gray);
colorbar(ax1, 'eastoutside');
axis(ax1, [XLim(1) XLim(2) YLim(1) YLim(2)]);
caxis(ax1, [dBLim(1) dBLim(2)]);
set(ax1, 'FontName', 'Arial','FontSize',14);
Does anybody know why the grey plot get so imprecise?
The only difference in code to the coloured one is the "colormap" command.
Best regards
Tobias

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by