gramm
gramm copied to clipboard
Barplot in logarithmic x-axis
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();