【发布时间】:2016-10-09 03:55:47
【问题描述】:
在具有两个 y 轴的图表中,一个用于折线图(左)和一个用于条形图(右),我希望条形图位于折线图下方以获得更好的可见性,而不是上方它。
正如你在这张图片上看到的(我希望你能看到),条形图显示了降水的演变,不同的线显示了叶绿素指数的演变,我的问题是条形图覆盖了线条我希望这条线更高。
这是我的脚本:
figure
yyaxis right
bar (meteo(:,1),meteo(:,14));
ylabel('Precipitation (mm)');
hold on
for i=1:6;
a = [];
b = [];
color = ['r' 'm' 'b' 'c' 'g' 'y'];
for j=0:6
a(i,j+1)=matrice_5(j*6+i,1);%jour
b(i,j+1)=matrice_5(j*6+i,3);%moyenne
end
hold on
yyaxis left
plot(a(i,:),b(i,:),color(i),'LineWidth',1.5);
end
title('Evolution of the mean of the chlorophyll index (HNT) - Charlotte variety');
xlabel('Day (2013)')
ylabel('Chlorophyll index (HNT)')
axis([735390 735442 32 50]);
set(gcf,'Position',[645 206 701 477]);
datetick('x','dd mmm','keepticks')
h=legend('0','50','100','150','200','250','precipitation','Location','best');
v = get(h,'title');
set(v,'string','Nitrogen rate in kg/ha');
set(h,'Position', [0.1793 0.1494 0.1127 0.2446]);
hold on
plot([735422 735422],[32 49],'Color',[.3 .3 .3]);
hold off
到目前为止,我只得到了一半的结果。我想将条形图放在左轴(y 轴左)上,将折线图放在右轴上。我想把叶绿素指数保留在左边。
感谢您的帮助
【问题讨论】: