bwoodsend / vtkplotlib

VTK (C++ 3D graphics library) wrapped into an easy to use 3D equivalent of matplotlib
MIT License
40 stars 6 forks source link

How to change 2d text dynamicly? #19

Closed JamesKnochen closed 1 year ago

JamesKnochen commented 1 year ago

Im trying to display the coordinates I clicked on in the bottom left corner. I used the OnClick function to put the current coordinates as 2d text on the plot. The issue is, that when I click again the next coordinates get written ontop of the others. Is there a way to delete the old coordinates?

bwoodsend commented 1 year ago

If you store the output of vpl.text(), you can write to its .text attribute.

text = vpl.text("hello")
text.text = "good bye"