문제

The mayavi module for Python has a 3D scatter plotting function. By default the size of the points are scaled with the data (as far as I could understand from going through their website). This is what a screencap of my data looks like:

Mayavi Point Scatter

The colormap indicates the value of each point, so I don't require the size of the point to also scale with the value of the point. Is there any way to disable scaling of size?

도움이 되었습니까?

해결책

The function mayavi.mlab.points3d has the scale_mode argument which can be set to 'none'.

For example:

In [23]: t = linspace(0, 4*numpy.pi, 20)

In [24]: x = sin(2*t)

In [25]: y = cos(t)

In [26]: z = cos(2*t)

In [27]: s = 2 + sin(t)

In [28]: mlab.points3d(x, y, z, s, colormap="copper", scale_mode='none')
Out[28]: <mayavi.modules.glyph.Glyph at 0x9fd85f0>

Here's a screenshot of the plot:

screenshot

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top