#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import k3d
plot = k3d.plot()
plot += k3d.text2d('\\int_{-\\infty}^\\infty \\hat f(\\xi)\\,e^{2 \\pi i \\xi x} \\,d\\xi',
[0.75,0.5], color=0, size=1.5, reference_point='lt')
plot += k3d.text2d('{(1,1,\\frac{5}{\\pi})}', [0.25, 0.5],
color=0, size=1.5, reference_point='rb')
plot += k3d.text2d('
Important!
HelloWorld', [0.5, 0.5],
color=0, size=1.5, is_html=True, reference_point='rb')
plot.display()
# In[ ]:
plot.objects[0].label_box = False
# In[ ]:
# Multipile texts in single object
import numpy as np
N = 20
positions = np.random.randn(N,2).astype(np.float32)
plot2 = k3d.plot()
obj = k3d.text2d(["lorem ipsum"] * N, positions, is_html=True)
plot2 += obj
plot2.display()
# In[ ]:
obj.text= list(map(lambda a: str(a), list(range(N))))
# In[ ]:
obj.position = np.random.randn(N,2).astype(np.float32)
# In[ ]: