How drawing a rectangle in a semilog plot ?

1 回表示 (過去 30 日間)
frederic Villard
frederic Villard 2015 年 8 月 9 日
回答済み: Walter Roberson 2015 年 8 月 9 日
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 Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by