I want to graph the function x(t) = tan(t), -pi
Package PGF Math Error: Could not parse input '' as a floating
point number, sorry. The unreadable part was near ''. (in '$-\pi $').
as my error.
any suggestions?
I want to graph the function x(t) = tan(t), -pi
Package PGF Math Error: Could not parse input '' as a floating
point number, sorry. The unreadable part was near ''. (in '$-\pi $').
as my error.
any suggestions?
It's hard to tell without an example of your code. My guess is you are using the pi symbol ($\pi$) rather than the pi constant (pi).
This should work:
\begin{tikzpicture}
\begin{axis}[
domain = -pi/2+0.1:pi/2-0.1,
samples = 200
]
\addplot[black]{tan(deg(x))};
\end{axis}
\end{tikzpicture}
Also see here for a more comprehensive example.
Another solution with PSTricks using pst-plot and pst-math.
\documentclass{article}
\usepackage{pst-plot}
\usepackage{pst-math}
\begin{document}
\begin{pspicture}*(-4.5,-2)(4.5,2)
\SpecialCoor
\psaxes[trigLabelBase=2,dx=\psPiH,xunit=\psPi,trigLabels]%
{->}(0,0)(-2,-4.5)(2,5.5)[$x$,0][$y$,90]
\psset{algebraic=true}
\psplot[yMaxValue=6,yMinValue=-3,linewidth=1.6pt,plotpoints=2000,
linecolor=red]{-5}{5}{tan(x)}
\psline[linestyle=dotted](-\psPiH,-5)(-\psPiH,5)
\psline[linestyle=dotted](\psPiH,-5)(\psPiH,5)
\end{pspicture}
\end{document}