enthought / enthought/mayavi

Mask_points doesn't work for mesh

Open
#548 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

I'm using mesh() to plot a surface defined by 2D arrays of 20 points and I would like to reduce the displayed points, I saw the mask_points kwarg would do just what I want, but for some reason it isn't working. I tried an example with quiver3d() and it works fine.

This is the code, for any value on mask_points, the plot remains the same.

```
import numpy as np
from mayavi import mlab

k = 2*np.pi
long = 0.5
numberpts=20
theta = np.linspace(0, np.pi, numberpts)
phi = np.linspace(0, 2*np.pi, numberpts)
PHI, THETA = np.meshgrid(phi, theta)
R = np.absolute((np.cos(k*long/2*np.cos(THETA))-np.cos(k*long/2))/np.sin(THETA))
R = np.nan_to_num(R)
X = R * np.sin(THETA) * np.cos(PHI)
Y = R * np.sin(THETA) * np.sin(PHI)
Z = R * np.cos(THETA)
plot = mlab.mesh(X, Y, Z, mask_points =2)
mlab.show()
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.