Log Scale axis and Transparency do not work together in Matlab
Why?
OpenGl renderer, (which must be used for the transparency) does not support logarithmic axis - this is apparently in the documentation as of 2010b and is also mentioned here
Solution
Mimic Log axis by transforming data & setting Yaxis ticks
the code below makes the bar plot with log axis, gets the required properties, clears the axis and then uses the information to mimic the log axis
code:
subplot('Position',[0.15 0.7 0.45 0.15]);
data = [1 2 5 4 7 4 1];
B = bar(data,'g');
set(gca,'Yscale','log')
ticks=get(gca,'Ytick');
ticklabel=str2num(get(gca,'YtickLabel'));
set(gca,'Yscale','linear')
cla
B = bar(log(data),'g');
set(gca,'Ytick',log(ticks));set(gca,'YtickLabel',10.^ticklabel)
ch = get(B,'child');
set(ch,'facea',.3)
The only loss is the formatting of tick labels.
Finally I cant guarantee anything when applied to negative data, although it will almost certainly throw a warning and not work properly!