【发布时间】:2016-10-26 21:30:27
【问题描述】:
我有一个按钮,通过单击它可以生成绘图及其颜色条。该按钮与称为 zzpcolor 的某些功能相关。在 zzpcolor 中,我使用 pcolor 语法来生成抖动图。
在回调函数内部,我使用hold on 来保持zzpcolor 生成的图形。然后我将另一个图添加到同一轴。这是按钮回调中脚本的一部分。
axes(handles.axes1);
axes1.Position=[0.1300 0.1100 0.7750 0.8150];
[X,Y,Z]=plotpcolor(fnamedat);
hold on
zzpcolor(X,Y,Z);
shading flat
LimitPlot
hold on
plot_google_map
hold on
scatter(datageo(:,1),datageo(:,2),'MarkerFaceColor',[1 0 0])
hold off
语法工作得很好。我使用这种语法将绘图保存为 jpg 在另一个回调函数中。
newfig1 = figure('Visible','off');
copyobj(handles.axes1, newfig1);
[filename,pathname]= uiputfile('*.jpg','Save as');
hold on
wmmicolorbarsetting;
saveas(newfig1,[pathname,filename],'jpg');
它工作得很好。但是当我尝试使用类似这样的语法将其保存为 .fig 时,
newfig1 = figure('Visible','off');
copyobj(handles.axes1, newfig1);
[filename,pathname]= uiputfile('*.fig','Save as');
hold on
wmmicolorbarsetting;
saveas(newfig1,[pathname,filename],'fig');
.fig 文件不包含任何内容。为什么?
【问题讨论】:
标签: matlab user-interface callback matlab-figure matlab-guide