-
-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #33002: Method tikz of polyhedron class can now return an object…
… of type TikzPicture As a follow up of #20343, the current branch now allows to specify the output type of the `tikz` method of a polyhedron: {{{ sage: co = polytopes.cuboctahedron() sage: t = co.tikz([674,108,-731], 112, output_type='TikzPicture') sage: t \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}% [x={(0.249656cm, -0.577639cm)}, y={(0.777700cm, -0.358578cm)}, z={(-0.576936cm, -0.733318cm)}, scale=1.000000, --- 92 lines not printed (5190 characters in total). Use print to see the full content. --- \node[vertex] at (1.00000, 0.00000, 1.00000) {}; \node[vertex] at (1.00000, 1.00000, 0.00000) {}; %% %% \end{tikzpicture} \end{document} sage: t.pdf() '/tmp/tmpobwhg3p7/tikz_o9dkz419.pdf' }}} We also change the default behavior in favor of `output_type='TikzPicture'`. A deprecation warnings is now sent when `output_type` is not given: {{{ sage: co = polytopes.cuboctahedron() sage: t = co.tikz([674,108,-731], 112) ... DeprecationWarning: Since SageMath 5.13 (ticket #12083), the method .tikz() of a polyhedron returns an object of type ``LatexExpr`` which is a Python str. Since SageMath 9.7, this default behavior of returning an object of type LatexExpr is deprecated as the default output will soon change to an object of type ``TikzPicture`` from the module sage.misc.latex_standalone (newly introduced in SageMath 9.6). Please update your code to specify the desired output type as ``.tikz(output_type='LatexExpr')`` to keep the old behavior or ``.tikz(output_type='TikzPicture')`` to use the future default behavior. See https://trac.sagemath.org/33002 for details. }}} URL: https://trac.sagemath.org/33002 Reported by: slabbe Ticket author(s): Sébastien Labbé Reviewer(s): Laith Rastanawi
- Loading branch information
Showing
5 changed files
with
224 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.