File: test-sagetex.tex

package info (click to toggle)
vim-vimtex 2.17-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,844 kB
  • sloc: makefile: 360; python: 103
file content (47 lines) | stat: -rw-r--r-- 1,053 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
\documentclass{article}
\usepackage{sagetex}
\begin{document}

\begin{sagesilent}
"""Example script."""
import pickle
import mytexmodule as tex

with open('modes.p', 'rb') as file:
    data = pickle.load(file)

def random_function(arg):
    return 3

ans = random_function(data)

# No actual data plotted
plt = plot([], (0, 7),
           axes_labels=[r"$\omega/\omega_\lambda$",
                        r"$\beta_\lambda$"],
           ticks=[[0, 1, sqrt(3), *optima], None],
           tick_formatter=[[r"$0$", r"$1$", r"$\sqrt{3}$",
                            *s.serialize(*optima, data=True)], None],
           detect_poles='show')

xi_eta_table = tex.Table(
    title=r"Values of $\xi$ and $\eta$ for the first ten cylindrical modes")
\end{sagesilent}

The answer is \sagestr{tex.texify(ans)}.

\begin{table}[ht]
  \centering
  \sagestr{xi_eta_table.latex}
  \caption{Some caption here.}
  \label{plot1}
\end{table}

\begin{figure}[ht]
  \centering
  \sageplot[]{plt}
  \caption{Another caption here.}
  \label{plot2}
\end{figure}

\end{document}