ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 18 Dec 2016 11:46:44 -0600What is the difference between show() and view() in sage?http://ask.sagemath.org/question/36047/what-is-the-difference-between-show-and-view-in-sage/What is the difference between show() and view() in sage?
`A=matrix([v1,v2,v3]);show(A); view(A)`
looks like the same... is there any difference between these two?
For the screen shot [click here.](https://drive.google.com/file/d/0B62JR2iJ8Ep_T09Gel9GSG9kM2M/view?usp=sharing)
![image description](https://drive.google.com/file/d/0B62JR2iJ8Ep_T09Gel9GSG9kM2M/view?usp=sharing)Sun, 18 Dec 2016 10:56:30 -0600http://ask.sagemath.org/question/36047/what-is-the-difference-between-show-and-view-in-sage/Answer by tmonteil for <p>What is the difference between show() and view() in sage?</p>
<p><code>A=matrix([v1,v2,v3]);show(A); view(A)</code></p>
<p>looks like the same... is there any difference between these two?</p>
<p>For the screen shot <a href="https://drive.google.com/file/d/0B62JR2iJ8Ep_T09Gel9GSG9kM2M/view?usp=sharing">click here.</a></p>
<p><img alt="image description" src="https://drive.google.com/file/d/0B62JR2iJ8Ep_T09Gel9GSG9kM2M/view?usp=sharing"></p>
http://ask.sagemath.org/question/36047/what-is-the-difference-between-show-and-view-in-sage/?answer=36048#post-id-36048As said by their respective documentation (type `show?` and `view?`), `show` is an alias for `pretty_print` which choses the "best" output supported by the user interface, and while `view` computes a LaTeX representation of the object (and possibly compiles the result from mathjax in the notebook or LaTeX from the command line), hence it is more specific.
For your matrix, you can see a difference if you use Sage command line:
sage: show(A);
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\begin{array}{rrr}
0 & 1 & 0 \\
0 & 1 & 0 \\
2 & \frac{1}{2} & 0
\end{array}\right)
sage: view(A)
# this will open a pdf viewer with the matrix inside a pdf, created by LaTeX.
You can also see a difference as follows:
sage: G = graphs.PetersenGraph()
sage: show(G)
# Launch png viewer, not created by LaTeX
sage: view(G)
# show a graph drawn by LaTeX inside a pdf viewerSun, 18 Dec 2016 11:46:44 -0600http://ask.sagemath.org/question/36047/what-is-the-difference-between-show-and-view-in-sage/?answer=36048#post-id-36048