Open mathewwe opened 1 year ago
Hi, yes that could be a nice feature to add, meanwhile you can create a dummy Marker object e.g:
from vedo import *
mesh = Mesh(dataurl + "bunny.obj")
nv = mesh.ncells
scals = range(nv)
lut = build_lut(
[
(nv / 2, "green5"),
(nv, "red5"),
],
vmin=0,
vmax=nv,
)
mesh.cmap(lut, scals, on="cells")
mesh.legend("Bunny mesh")
mk1 = Marker("*").c("green5").legend("cool faces")
mk2 = Marker("*").c("red5").legend("ugly faces")
lb = LegendBox(
[mesh, mk1, mk2],
markers=["s", "o", "0"],
font="Cartoons123",
width=0.4,
height=0.2,
)
plt = Plotter()
plt.show(mesh, lb, axes=1)
Hi @marcomusy ,
I am working on coloring certain sections of polygons in a mesh, which has been working well. However, I would also like to use a LegendBox or something similar to label the different colored sections of the mesh. As of right now, I have not found a way to do this. It looks like the LegendBox class only accepts separate objects as entries. Is it possible to manually add entries? Otherwise, should the mesh be split into parts, or a dummy object added to create a legend entry manually? Any advice would be helpful. For reference, the relevant code snippet for testing the mesh colorization is below:
Thanks!