enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.3k stars 284 forks source link

scatter plot with labels #1143

Open fred4ets opened 2 years ago

fred4ets commented 2 years ago

Hi Prabhu and all,

I come back to work on my own app using Mayavi after many years using Chaco.

And thus, I have a few questions.

I would like to display labeled scatter, ie with a list/array of string.

I could use Text module but it requires to add it for each point, that I don't want.

I would like to use something like Labels module and its mapper LabeledDataMapper, but it only works for points ids or scalars or so on.

I read a few hints here: https://kitware.github.io/vtk-examples/site/Cxx/Visualization/LabelPlacementMapper/ and here: https://stackoverflow.com/questions/15048553/vtk-put-label-text-near-points-in-the-3d-plot

but I can't seem how to code it for my own purpose.

Any idea?

Thanks in advance.

Regards