I found out about text3d and use that to add labels.
g=F.plot(point={'color':'red'})
T=[text3d("{}".format(pt),pt) for pt in f]
labels = T[0]
for i in range(len(T)-1):
labels = labels + T[i+1]
show(g+labels)
On Friday, November 3, 2017 at 12:15:58 PM UTC-4, egunawan wrote:
>
> Is it possible to add vertex labels when I plot Polyhedron? For example,
> below is my code for displaying a polytope, and I would like to be able to
> see the labels (1,1,1), (1,1,2), etc for all the corresponding vertices. (I
> am doing this in CoCalc)
>
> f=[
> [1,1,1],
> [ 1,1,2 ],
> [ 1,2,1 ],
> [ 1,2,3 ],
> [ 1,3,2 ],
> [ 2,1,1 ],
> [ 2,1,2 ],
> [ 2,3,1 ],
> [ 2,3,4 ],
> [ 2,5,3 ],
> [ 3,2,1 ],
> [ 3,2,3 ],
> [ 3,5,2 ],
> [ 4,3,2 ]
> ]
> F=Polyhedron(vertices=f)
> F.plot(point={'color':'red'})
>
>
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.