Why alpha transparency property has a bug below y-axis value zero?

1 回表示 (過去 30 日間)
Silvia
Silvia 2014 年 8 月 14 日
コメント済み: Supreeth Subbaraya 2014 年 8 月 14 日
Hello, I need to plot two different area object, originated from two different sets of data, in the same plot. To make them visible I need to have transparency, but if I use the alpha property I obtain a different shade of color for the same area under the 0 value of the y-axis.
Can someone help me solving this problem?
A=area(X (Y-X))
alpha .5 set(gca,'Layer','top') set(A(1),'FaceColor',[1 1 1]) set(A(2),'FaceColor',[.7 .9 .1]) set(A,'LineStyle','none')
X and Y are vectors.
Thanks
  1 件のコメント
Supreeth Subbaraya
Supreeth Subbaraya 2014 年 8 月 14 日
If X and Y are vectors, then "set(A(2),'FaceColor',[.7 .9 .1])" would result in an error because index in A(2) would exceed the matrix dimensions. So I think they cannot be vectors. Please let us know the type of data you are using. I tried the following code. I could see that the transparency was applied to both the layers and not to a single layer. So the color changes and it is expected. Is this the issue you are facing?
X = [1:4; 1:4]'
Y = exp(X);
A=area(X,(Y-X))
alpha .5
set(gca,'Layer','top')
set(A(2),'FaceColor',[.7 .9 .1])
set(A,'LineStyle','none')

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by