다음 세그먼트 코드가 있습니다 tikz
.
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=3cm,y=2cm]
\draw[->,color=black] (-0.9,0.) -- (1.9,0.);
\foreach \x in {}
\draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};
\draw[->,color=black] (0.,-2.4) -- (0.,2.4);
\foreach \y in {}
\draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};
\draw[color=black] (0pt,-10pt) node[right] {};
\clip(-0.9,-2.4) rectangle (1.9,2.4);
\draw[<->,line width=1.2pt,color=qqqqff,smooth,samples=100,domain=-0.9:1.9] plot(\x,{3.0*(\x)^(3.0)-5.0*(\x)^(2.0)+(\x)+1.0});
\draw[line width=1.2pt,color=ffqqqq,smooth,samples=100,domain=-0.9:1.9] plot(\x,{9.0*(\x)^(2.0)-10.0*(\x)+1.0});
\draw [dash pattern=on 1pt off 1pt] (0.11111111164602015,-4.279272269869239E-9)-- (0.11111111164602015,1.0534979423868314);
\draw (-0.32,0.05) node[anchor=north west] {$\frac{1}{3}$};
\draw (0.06,0.07) node[anchor=north west] {$\frac{1}{9}$};
\draw (0.52,0.03) node[anchor=north west] {$\frac{5}{9}$};
\draw [dash pattern=on 1pt off 1pt] (0.54,0.54)-- (0.54,0.);
\draw (0.24,0.70) node[anchor=north west] {\tiny{Punto de inflexión}};
\draw (0.11,1.25) node[anchor=north west] {\tiny{máximo}};
\draw (0.8,1.37) node[anchor=north west] {$C'(x)$};
\draw (1.15,1.21) node[anchor=north west] {$C(x)$};
\draw (0.98,-0.20) node[anchor=north west] {\tiny{mínimo}};
\end{tikzpicture}
그 결과는 다음과 같습니다.
그리고 나는 이런 결과를 원한다
어떻게 해야 합니까?
답변1
<->
마킹 장식을 사용하거나 넣을 수 있습니다 . 그러나 문제는 곡선을 자르는 것입니다. 따라서 끝점을 찾는 것이 어려워집니다. 따라서 곡선의 끝점이 잘린 영역 내에 위치하도록 도메인을 주의 깊게 조정해야 합니다. 다음은 샘플입니다.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,arrows.meta,decorations.markings}
\tikzset{myarrow/.style={draw,decoration={markings, mark=at position 0 with {\arrow{<}},mark=at position 1 with {\arrow{>}}},postaction={decorate}}
}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=3cm,y=2cm]
\draw[->,color=black,] (-0.9,0.) -- (1.9,0.);
\foreach \x in {}
\draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};
\draw[->,color=black] (0.,-2.4) -- (0.,2.4);
\foreach \y in {}
\draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};
\draw[color=black] (0pt,-10pt) node[right] {};
\clip(-0.95,-2.5) rectangle (1.95,2.5);
\draw[<->,line width=1.2pt,color=orange,samples=100,domain=-0.6:1.65] plot(\x,{3.0*(\x)^(3.0)-5.0*(\x)^(2.0)+(\x)+1.0});
\draw[myarrow,line width=1.2pt,color=brown,samples=100,domain=-0.11:1.235] plot(\x,{9.0*(\x)^(2.0)-10.0*(\x)+1.0});
\draw [dash pattern=on 1pt off 1pt] (0.11111111164602015,-4.279272269869239E-9)-- (0.11111111164602015,1.0534979423868314);
\draw (-0.32,0.05) node[anchor=north west] {$\frac{1}{3}$};
\draw (0.06,0.07) node[anchor=north west] {$\frac{1}{9}$};
\draw (0.52,0.03) node[anchor=north west] {$\frac{5}{9}$};
\draw [dash pattern=on 1pt off 1pt] (0.54,0.54)-- (0.54,0.);
\draw (0.24,0.70) node[anchor=north west] {\tiny{Punto de inflexión}};
\draw (0.11,1.25) node[anchor=north west] {\tiny{máximo}};
\draw (0.8,1.37) node[anchor=north west] {$C'(x)$};
\draw (1.15,1.21) node[anchor=north west] {$C(x)$};
\draw (0.98,-0.20) node[anchor=north west] {\tiny{mínimo}};
\end{tikzpicture}
\end{document}
다음은 pgfplots
. 나는 다른 것들을 연습으로 남겨두고 곡선을 그렸습니다.
\documentclass{article}
\usepackage{pgfplots}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[>=triangle 45,]
\begin{axis}[width=\linewidth,
axis lines=center,
xmin=-1,xmax=3,
ymin=-3,ymax=3,
axis line style={->}
]
\addplot+[<->,mark=none,line width=1pt,samples=100,domain=-0.6:1.65] {3*(x^3)-5*(x^2)+x+1};
\addplot+[<->,mark=none,line width=1pt,samples=100,domain=-0.145:1.25] {9*(x^2)-10*(x)+1};
\end{axis}
\end{tikzpicture}
\end{document}