我已经在matlab中的一个GUI文件上创建了两个绘图。我希望将每个图标记如下:第一个图:x轴的标签是位置,y轴是浓度:第二个图:x轴的标签是时间,y轴是浓度:问题是第二个图没有得到它的标签
代码:
C = {'k','b','r','g','y',[.5 .6 .7],[.8 .2 .6]}; % Cell array of colorss.
phandles = plot(tott,XX(rown,:),'color',C{ind},'parent',handles.axes2);
hold on
xlabel('time');
ylabel('Concentration (mol/m3)');
title('concentration at given position vs time') axis([tott(1),tott(length(tott)),0,conc]) 发布于 2015-04-22 02:29:28
xlabel article显示了如何使用打印句柄(在本例中为phandles)更改标签。获得你的第二个情节的句柄,并使用下面的玩具示例作为参考,或者发布你的第二个情节的代码,以便我可以澄清。
ax1 = subplot(2,1,1);
plot((1:10).^2)
xlabel(ax1,'Population')
ax2 = subplot(2,1,2);
plot((1:10).^3)调用subplot时返回的变量是绘图的句柄。基本上,如果你的第二个句柄叫做phandles2,那么你可以简单地使用:
xlabel(phandles2,'X Axis label for Plot 2');
ylabel(phandles2,'X Axis label for Plot 2');请将您的第二个图的代码张贴出来,以获得更详细的答案。
https://stackoverflow.com/questions/29777989
复制相似问题