我已经指定函数 x(1 - x)^{1/5} 应绘制在域 [-1.5,2.5] 上。它仅绘制在域 [1,2.5] 上。
\documentclass[10pt]{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\noindent \hspace*{\fill}
\begin{tikzpicture}
\begin{axis}[width=6in,axis equal image,unit vector ratio={2 1},clip=false,
axis lines=middle,
xmin=-1.5,xmax=2.5,
domain=-1.5:2.5, samples=201,
xlabel=$x$,ylabel=$y$,
ymin=-1,ymax=3,
restrict y to domain=-1:3,
%enlargelimits={abs=1cm},
axis line style={latex-latex},
ticklabel style={font=\tiny,fill=white},
xtick={\empty},ytick={\empty},
extra x ticks={0.83333, 1, 1.6666},
extra x tick labels={$\frac{5}{6}$, $1$, $\frac{5}{3}$},
extra y ticks={-2},
extra y tick labels={$ma+b$},
yticklabel style={anchor=west},
yticklabel shift=-4pt,
ticklabel style={font=\tiny,fill=white},
xtick={0.83333, 1, 1.6666},ytick={\empty},
xlabel style={at={(ticklabel* cs:1)},anchor=north west},
ylabel style={at={(ticklabel* cs:1)},anchor=south west}
]
\addplot[samples=501,domain=-1.5:2,blue] {x*(x - 1)^(0.2)};
\draw [fill] (0.83333,-0.8034) circle [radius=1.5pt];
\draw [fill] (1,0) circle [radius=1.5pt];
\draw [fill] (1.6666,1.53685) circle [radius=1.5pt];
\end{axis}
\end{tikzpicture}
\hspace{\fill}
\vskip0.2in
\end{document}
答案1
你可以使用以下方法获取真正的根
declare function={
realroot(\n,\x) = ((abs(\x))^(1/\n))*(\x)/abs(\x);
}
然后你得到以下情节,这似乎同意WolframAlpha 做什么:
\documentclass[10pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}[
declare function={
realroot(\n,\x) = ((abs(\x))^(1/\n))*(\x)/abs(\x);
}
]
\begin{axis}
\addplot[samples=351,domain=-1.5:2,blue] {
x*realroot(5,x-1)
};
\end{axis}
\end{tikzpicture}
\end{document}