乳胶图错误的图

Latex Plot wrong Graph

你们知道为什么 Latex 绘制了错误的函数吗?

这是我的功能:

     \draw [scale=0.5,domain=-3:3,smooth,variable=\x] plot (\x,0.5*\x^4 - 3*\x^2+ 4) node[right] {$f(x)=0.5*x^4 - 3*x^2 + 4$};

这是结果: Latex Graph

但是应该是这样的: Right Graph

谢谢

tikz中,需要括号才能正确计算负数的平方。

\draw [scale=0.5,domain=-3:3,smooth,variable=\x] plot (\x,{0.5*(\x)^4 - 3*(\x)^2+ 4}) node[right] {$f(x)=0.5*x^4 - 3*x^2 + 4$};

这应该产生什么 you wanted.