在Octave上设置表面图的透明度 [英] Setting transparancy of surface plot on Octave
问题描述
我正在运行Octave 3.4.0,并想创建一个透明的曲面图.但是,在弄乱facealpha
,edgealpha
,alphadata
和alphadatamapping
时,我无法做到这一点.
I am running Octave 3.4.0 and want to create a transparent surface plot. However, I have not been able to do so when messing around with facealpha
, edgealpha
, alphadata
and alphadatamapping
.
用于创建不透明表面的示例代码:
Example code for creating a non-transparent surface:
p = peaks(40);
f1 = figure(10);clf
s1 = surface(p)
view(3)
xlabel('x');ylabel('y');
hold on;plot3([0 40],[40 0],[-10 10],'k')
set(s1,'edgecolor','none')
set(s1,'facealpha',0.2)
此结果在下图中给出.如您所见,即使曲面是半透明的,开始时绘制的线也隐藏在曲面的后面.这是我的Octave版本中的错误,还是我错过了什么?
The result of this given in the image below. As you can see, the line drawn diagnonlly at the start is hidden behind the surface, even though the surface is suppose to be semi-transparent. Is this a bug in my version of Octave, or have I missed something?
推荐答案
这在使用gnuplot作为图形工具包的Octave 3.6.2上对我有效.因此,您最好升级八度安装.
This works for me on Octave 3.6.2 using gnuplot as the graphics toolkit. So you better upgrade your Octave installation.
但是要注意两件事:
- 对角线表面后面的部分没有在打火机中绘制,因此看起来仍然很奇怪;
- 使用新的实验性fltk图形工具包,它根本无法工作.
这篇关于在Octave上设置表面图的透明度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!