Closed ManuGraiph closed 6 months ago
Hi! There are tons of examples with color mapping:
vedo --search cmap
Eg
examples/basic/colormaps.py
examples/basic/mesh_coloring.py
something like
mymesh.cmap("jet_r", "temp", vmin=-20, on="cells")
mymesh.add_scalarbar3d("Temperature")
could apply to your case.
Worked perfect by changing jet_r
to jet`, thanks a lot!
A couple questions tho...
How can i change which celldata value (in case i had more than one) is used for the colormap? The second argument ('temp') does that?
For some reason (i run everything on repl, not as a script), vedo plot objects don't seem to 'clean' in the same session if i change something in the mesh definition and run the plot again. For ex. if i plot a mesh object, change the faces and plot it again in the same session, it kinda plots "both". Is there any way to "clear" the vedo.show()
plot?. I run a couple custom lines between runs to clear all user vars/functions, but the plot still persists.
Thanks in advance!
Worked perfect by changing
jet_r
to jet`, thanks a lot!A couple questions tho...
- How can i change which celldata value (in case i had more than one) is used for the colormap? The second argument ('temp') does that?
Yes.
- For some reason (i run everything on repl, not as a script), vedo plot objects don't seem to 'clean' in the same session if i change something in the mesh definition and run the plot again. For ex. if i plot a mesh object, change the faces and plot it again in the same session, it kinda plots "both". Is there any way to "clear" the
vedo.show()
plot?. I run a couple custom lines between runs to clear all user vars/functions, but the plot still persists.
Either show().clear()
or (best practice):
plt= Plotter()
...
plt.show() # you call this only once
...
# some loop or callback
plt.remove("SomeObject").add(my_new_obj)
plt.render()
you can assign custom names witth
my_new_obj.name=""MySphere
Worked flawless, thanks a lot again!
Oh, a small little thing i forgot.. It's possible to add to the plot labels for the cells (not the points) with thext from celldata and/or another source?
Hi Marco!
I'm trying to build some FEM-from-scratch implementation using vedo for visualization and class wrapping but i can't manage to get a correct plotting of the cell colors. I'm assigning values to celldata in a mesh and trying to make a heatmap plot with them, but i don't know very well how to use the
vedo.show()
function or what are its arguments and the output is like showing the colorscale reversed.I basically have a field in celldata called 'temp' with values and when i call
vd.show(mesh)
i get this:The colorscale, field in celldata, etc get selected automatically and i haven't been able to find any way to modify them.
Any ideas?
Thanks in advance!