How drawing a rectangle in a semilog plot ?

1 次查看(过去 30 天)
I try to draw a transparent rectangle in a semilog plot,
With the function fill and the propertie 'FaceAlpha" it work with a linear plot
but don't work in a semilogx plot !!!
more over, I don't find help about 'FaceAlpha' properties.
an example:
clear all;
close all;
c=[0.6 0 1];
figure;
hold on;
plot(cumsum(ones(1,100)),0.25*cumsum(ones(1,100)),'r');
fill([1 1 50 50], [0 10 10 0],c, 'FaceAlpha', 0.4,'EdgeColor','none');
grid on;
figure;
hold on;
set(gca,'XScale','log');
plot(cumsum(ones(1,100)),0.25*cumsum(ones(1,100)),'r');
fill([1 1 50 50], [0 10 10 0],c, 'FaceAlpha', 0.4,'EdgeColor','none');
grid on;

回答(1 个)

Walter Roberson
Walter Roberson 2015-8-9
Unfortunately you will not be able to do transparency with log plots (unless the situation changed as of R2014b): http://www.mathworks.com/matlabcentral/newsreader/view_thread/241372
fill() is documented as creating patch() objects and the fill documentation references patch properties which defines FaceAlpha

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by