同样的代码,在window下安装的CTex绘制2^x的图象不对(如上图),但在Online LaTeX Editor 下绘制的2^x的图象(如下图)又是正确的,请问怎样在WinEdt 下绘制2^x的图象?
\documentclass{book}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.4]
\draw[->,>=stealth](-5,0)--(3,0) node at (3,-0.4){$x$};
\draw[->,>=stealth](0,-2)--(0,4) node at (-0.4,3.9){$y$};
\draw[domain=-2:1.8,smooth] plot(\x,{2^\x});
\end{tikzpicture}
\end{document}
谢谢!