Transparent surface with log axis

7 ビュー (過去 30 日間)
Gergely
Gergely 2013 年 2 月 18 日
Dear All!
I wish to use transparency for my surface plots by setting an alpha map. However, transparency disappears when I set a log scale on any of the axes, e.g.
[x,y] = meshgrid([-2:.2:2]);
z = x.*exp(-x.^2-y.^2);
surf(x,y,z+.001,'FaceAlpha','flat',...
'AlphaDataMapping','scaled',...
'AlphaData',gradient(z),...
'FaceColor','blue');
alphamap('vup')
colormap jet;
shading interp;
%This is transparent so far. Setting YScale however, kills transparency:
set(gca, 'YScale', 'log')
Any ideas how to resolve the issue?

回答 (1 件)

Oleg Komarov
Oleg Komarov 2013 年 2 月 18 日
編集済み: Oleg Komarov 2013 年 2 月 18 日
However, you can use a manual workaround. You need to calculate the log-transformation of your values (excluding the negative ones) for the desired axis and then set manually the ticklabels.
  1 件のコメント
Gergely
Gergely 2013 年 2 月 18 日
Awww... thanks.

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

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by