![1/x^0.33 下 x 轴下方的曲线未出现](https://linux22.com/image/409279/1%2Fx%5E0.33%20%E4%B8%8B%20x%20%E8%BD%B4%E4%B8%8B%E6%96%B9%E7%9A%84%E6%9B%B2%E7%BA%BF%E6%9C%AA%E5%87%BA%E7%8E%B0.png)
我有这段代码可以在乳胶中绘制图形,但我不确定这有什么问题。
\begin{tikzpicture}
\begin{axis}[
axis lines = center, % middle
xlabel = $x$, ylabel = {$y$},
xmin = {-10},xmax = {12},
ymin = {-5},ymax = {7},
% restrict y to domain = -10:10,
xtick = \empty, ytick = \empty, % to add the label to the axis
extra x ticks = {-1,8}, % To just add specific points
% extra y ticks = {1}
% xtick={-10,...,10},
% ytick={-8,...,12}
]
\addplot[domain = -5:10, samples = 200, color = blue] {1/x^(1/3)} node[above left] {$f(x)=\dfrac{1}{\sqrt[3]{x}}$};
% \addplot[domain = -10:2, samples = 100, color = blue] {1/x^(1/3)}
\end{axis}
\end{tikzpicture}
我无法获得第三象限的曲线。
答案1
\documentclass[fleqn]{article}
\usepackage{amsmath}
\DeclareMathOperator{\sign}{sign}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
Note that
\[ x^\alpha=\exp(\alpha\,\ln x)\;,\]
so negative values are worrisome for fractional $\alpha$.
However, you can plot (cf.\ Figure~\ref{fig:plot})
\[ \sign x \cdot |x|^\alpha\;.\]
\begin{figure}[h]
\centering
\begin{tikzpicture}
\begin{axis}[
axis lines = center, % middle
xlabel = $x$, ylabel = {$y$},
xmin = {-10},xmax = {12},
ymin = {-5},ymax = {7},
% restrict y to domain = -10:10,
xtick = \empty, ytick = \empty, % to add the label to the axis
extra x ticks = {-1,8}, % To just add specific points
% extra y ticks = {1}
% xtick={-10,...,10},
% ytick={-8,...,12}
]
\addplot[domain = -5:10, samples = 200, color = blue] {sign(x)/abs(x)^(1/3)}
node[above left] {$f(x)=\dfrac{\sign x}{\sqrt[3]{|x|}}$};
% \addplot[domain = -10:2, samples = 100, color = blue] {1/x^(1/3)}
\end{axis}
\end{tikzpicture}
\caption{Plot of $f(x)=\dfrac{\sign x}{\sqrt[3]{|x|}}$.}
\label{fig:plot}
\end{figure}
\end{document}