gramm icon indicating copy to clipboard operation
gramm copied to clipboard

Barplot in logarithmic x-axis

Open Niklas123Niklas opened this issue 4 years ago • 0 comments

Hello, thanks for this nice adaption of graphics grammar to matlab. While I created a boxplot on a logarithmnic x-axis, the width of the boxes seems to be fixed for a specific value. This does not work for logarithmic axis. The width is changing from very wide boxes to thin lines over 2 decades. Is it possible to fix this behaviour for log axes?

Cheers Niklas

Try the following code:

%Create data
x=repmat(1:10,1,100);
catx=repmat([1 2 4 8 16 32 64 128 256 512]*0.01,1,100);
y=randn(1,1000)*3;
y=2+y+x+c*0.5;
%Draw
clear g
figure()
g=gramm('x',catx,'y',y);
g.stat_boxplot();
g.axe_property("XScale","log");
g.set_title('Width of Boxplot changes from thick to thin');
g.draw();

Niklas123Niklas avatar Jan 19 '21 10:01 Niklas123Niklas