重绘轴,条形图

时间:2015-02-25 16:10:33

标签: matlab matlab-figure

我正在使用白色函数barh来删除已绘制条形的部分。问题在于这种过度绘制带有白色的彩色条的方式也会绘制y轴的一部分。那么有没有更好的方法来重新绘制y轴:

plot([0 0][0 y_hat]); %?

使用:

barh(bar_val,'w','EdgeColor','w'); %have also tried: ...'EdgeColor','none'); 

对不起,这是一个代码,以便你可以看到问题。

%Matlab 2013a.
%TestCode BarPlot
V =[0 3 1;3 4 2;4 8 1;8 9 2;9 10 1;10 11 2;11 12 1;12 20 2];      

figure()
ii = size(V,1); 
    while ii > 0                                % Count down all ii
        Inx = V(ii,3);
        p(Inx) = subplot(2,1,Inx);                      
        hold on                                                           
        barh(V(ii,2),'b','EdgeColor','none');                           
        barh(V(ii,1),'w','EdgeColor','none');
        ii=ii-1;                            
    end; clear ii

0 个答案:

没有答案
相关问题