matlab双Y坐标轴,左边bar图,右边plot图,设置x轴横坐标为文字
大致程序如下:value1=[2.98,3.19,7.17,3.05,3.97,4.76];value2=[9,4,3,7,4,4];t=1:6[ax,h1,h2]=pl...
大致程序如下:
value1 = [2.98,3.19,7.17,3.05,3.97,4.76];
value2 = [9,4,3,7,4,4];
t = 1:6
[ax,h1,h2]=plotyy(t,value1,t,value2,@bar,@plot);
dr_name = {'一,'二,'三,'四,'五,'六};
set(gca,'XTickLabel',dr_name)
set(ax(1),'ytick',0:2:10);
set(ax(2),'ylim',[0 10],'ytick',0:10);
set(h1,'facecolor','y');
set(h2,'ro-');
现在问题是x轴文字和原来坐标重合和改变plot曲线的连接处有o 展开
value1 = [2.98,3.19,7.17,3.05,3.97,4.76];
value2 = [9,4,3,7,4,4];
t = 1:6
[ax,h1,h2]=plotyy(t,value1,t,value2,@bar,@plot);
dr_name = {'一,'二,'三,'四,'五,'六};
set(gca,'XTickLabel',dr_name)
set(ax(1),'ytick',0:2:10);
set(ax(2),'ylim',[0 10],'ytick',0:10);
set(h1,'facecolor','y');
set(h2,'ro-');
现在问题是x轴文字和原来坐标重合和改变plot曲线的连接处有o 展开
1个回答
展开全部
按下面语句试试
value1 = [2.98,3.19,7.17,3.05,3.97,4.76];
value2 = [9,4,3,7,4,4];
t = 1:6;
[ax,h1,h2]=plotyy(t,value1,t,value2,@bar,@plot);
dr_name = {'一','二','三','四','五','六'};
set(ax(1),'XTickLabel',dr_name,'ytick',0:2:10);
set(ax(2),'XTickLabel','','ylim',[0 10],'ytick',0:10);
set(h1,'facecolor','y');
set(h2,'marker','o','color','r','linewidth',1);
value1 = [2.98,3.19,7.17,3.05,3.97,4.76];
value2 = [9,4,3,7,4,4];
t = 1:6;
[ax,h1,h2]=plotyy(t,value1,t,value2,@bar,@plot);
dr_name = {'一','二','三','四','五','六'};
set(ax(1),'XTickLabel',dr_name,'ytick',0:2:10);
set(ax(2),'XTickLabel','','ylim',[0 10],'ytick',0:10);
set(h1,'facecolor','y');
set(h2,'marker','o','color','r','linewidth',1);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询