Ask Your Question

Export a Plot as Tikz to Latex

asked 2021-02-05 22:27:03 +0200

Lars gravatar image

updated 2021-02-05 22:27:45 +0200


a couple of days ago I drew a Polyhedra in sage cell Server and exported it as a Tikz file. like this:

P1 = Polyhedron(vertices = [[0,0,0], [1,2,1], [-4,-3,-2],[3,3,-2],[1,-4,3],[-2,2,1]]) P1.tikz([-0.0946,-0.4796,-0.8724],160.47, axis=true, opacity=0.25)

Now I got an Arrangement of Hyperplanes like: H3.<x,y,z> = HyperplaneArrangements(QQ) A = H3([(1,2,1), 0], [(-4,-3,-2), 0],[(3,3,-2), 0], [(1,-4,3), 0],[(-2,2,1), 0]) that I want to export as a Tikz file but it seems that this is not possible. Or am I just doesnt find it? Anyone there that can maybe help me?

Best regards

Lars Kroll

edit retag flag offensive close merge delete


That's because nobody has written the tikz method for hyperplane arrangement. Open source means that you can do it yourself to provide that for everybody else.

FrédéricC gravatar imageFrédéricC ( 2021-02-06 13:30:39 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2021-02-06 09:40:14 +0200

Emmanuel Charpentier gravatar image

A.plot() is inherently a 3D object. Its save method can save to various 2D image formats (but not .pgf), HTML or various specialized 3D formats. Its save_image method does not include .pgf as a valid output format.

Your best bet seems to start from one of these formats (or HTML) and convert it via the targe tool(s) for the choosen format. It might be possible to het three.js to output a Tikz picture...

It might also be possible to add Tikz output to the relevant save_image (or possibly save) method. Care to file a ticket for this ?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-02-05 22:27:03 +0200

Seen: 543 times

Last updated: Feb 06 '21