# Plot only producing straight line

I need to plot the function y = sec(x)/exp(tan(x)) however the code I used (which I've pasted below) only produces a straight line.

\begin{center}
\begin{tikzpicture}
\begin{axis}[xlabel={$x$},ylabel={$y$},
axis equal,axis lines=middle,
width=12cm,height=7cm,
xmin=-1.6,xmax=1.6,
ymin=-1,ymax=2,
yticklabel=\empty,xticklabel=\empty,
ytick=\empty,xtick=\empty]
\end{axis}
\end{tikzpicture}
\end{center}


I've tried individual functions. exp(x) worked, but tan(x) and sec(x) both similarly returned a straight line. Any help or guidance would be greatly appreciated!

• The trigonometric functions in pgf assume degrees as input, so you need trig format plots=rad in the axis options (or trig format=rad, which affects not only plots see the pgfplots manual), or convert to degrees with deg(x), or use the r postfix as in Luis' answer. – Torbjørn T. Aug 7 at 8:26

Maybe sec and tan are not being calculated in the correct way. Try something like sec((x)r) as in the following example (I changed the domain because -1.5to 1.5 gives numbers too big)

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}

\begin{document}

\begin{center}
\begin{tikzpicture}
\begin{axis}[xlabel={$x$},ylabel={$y$},
axis equal,axis lines=middle,
width=12cm,height=7cm,
xmin=-1.6,xmax=1.6,
ymin=-1,ymax=2,
yticklabel=\empty,xticklabel=\empty,
ytick=\empty,xtick=\empty]