marcomusy / vedo

A python module for scientific analysis of 3D data based on VTK and Numpy
https://vedo.embl.es
MIT License
1.98k stars 257 forks source link

Adding text to screenshot #1035

Closed priyabiswas12 closed 5 months ago

priyabiswas12 commented 5 months ago

Hi there,

May I know how to adjust the size and text font of the text on a screenshot? Thank you so much This is my code:

vp = Plotter(axes=0, offscreen=True) text = str(lab) vp.add(text) vp.show(item, interactive=False, at=0) screenshot(os.path.join(save_path,file_name))

marcomusy commented 5 months ago

You can create the text object explicitly eg:

txt = Text2D("some text", font="Kanopus", s=2.0)
...
show(txt, ...)

there are many examples:

vedo --search Text2D
priyabiswas12 commented 5 months ago

Ah ok thank you so much