gramm icon indicating copy to clipboard operation
gramm copied to clipboard

errorbar do not has horizontal line

Open Gery111 opened this issue 5 years ago • 2 comments

Hi,

I found something wrong in error bar. For example, x=abs([-1:0.4:0,-1:0.4:1,0.2:0.4:1]); y=rand(1,12); err=rand(1,12); tag0=cell(3,1);tag0=cellfun(@(x) 'a',tag0,'UniformOutput',false); tag1=cell(3,1);tag1=cellfun(@(x) 'b',tag1,'UniformOutput',false); tag=[tag1;tag0;tag0;tag1]; g=gramm('x',x,'y',y,'ymin',y-err,'ymax',y+err); g.facet_wrap(tag); g.geom_line; g.geom_interval('geom','errorbar'); g.draw; You can see that the errorbar do not has the horizontal line. If we just change the tag like: tag=[tag1;tag1;tag0;tag0]; or change the x like: x=-1:0.2:1.2; It's going to be normal now.

Gery111 avatar Jan 26 '20 13:01 Gery111

Hi @Gery111,

You are using a pretty vicious dataset ! The bug seems related to the functionality that "dodges" graphical elements so that they are not superimposed. Your code specifically generates multiple error bars at the same x location which are however in the same data group, with x data that is additionally not ordered. I'll look into it !

piermorel avatar May 07 '20 16:05 piermorel

Hi @piermorel ,

Thank you. Actually, the way of the simulated data is like my real data. Those two error bars at same x location are in the different group, which I didn't show it here. Because it's no horizontal line, error bars are overlaped, and I can't discriminate the error bars from two groups.

Gery111 avatar May 20 '20 09:05 Gery111