How drawing a rectangle in a semilog plot ?

7 Ansichten (letzte 30 Tage)
frederic Villard
frederic Villard am 9 Aug. 2015
Beantwortet: Walter Roberson am 9 Aug. 2015
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;

Antworten (1)

Walter Roberson
Walter Roberson am 9 Aug. 2015
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

Community Treasure Hunt

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

Start Hunting!

Translated by