Me gustaría que la figura se pareciera a la siguiente:
Sin embargo, la figura que produje no coincide con esta descripción. aquí están mis intentos
\documentclass[]{article}
\usepackage[left=.5cm,right=.5cm,top=3cm,bottom=1cm]{geometry}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{esvect}
\usepackage{ifthen}
\usepackage{stmaryrd}
\usepackage{xspace}
\usepackage{mathtools}
\newcommand{\lm}[2]{\displaystyle{\lim_{{#1}\to {#2}}}}
\begin{document}
\begin{center}
\begin{tikzpicture}
\node[rectangle, draw=brown, fill=brown!75, minimum height=1cm, minimum width=5cm, rounded corners] (1) {$\lm{x}{\infty}f(x) = a$};
\node[rectangle, draw=brown, fill=brown!75, minimum height=1cm, minimum width=5cm, rounded corners, right= 1cm of 1] (2) {$\lm{x}{\infty}f(x) = \infty$};
\node[rectangle, draw=brown, fill=brown!75, minimum height=1cm, minimum width=5cm, rounded corners, right= 1cm of 2] (3) {$\lm{x}{a}f(x) = a$};
\node[rectangle, draw=cyan, fill=cyan!50, minimum height=1cm, minimum width=5cm, rounded corners, below left= 1cm and 0cm of 2] (4) {$\lm{x}{\infty}\left[f(x) - (ax - b)\right] = 0$};
\node[rectangle, draw=cyan, fill=cyan!50, minimum height=1cm, minimum width=4cm, rounded corners, right= 1mm of 4] (5) {$\lm{x}{\infty}\dfrac{f(x)}{x} = a \ ; \ a \neq 0$};
\node[rectangle, draw=cyan, fill=cyan!50, minimum height=1cm, minimum width=3cm, rounded corners, right= 1mm of 5] (6) {$\lm{x}{\infty}\dfrac{f(x)}{x} = \infty$};
\node[rectangle, draw=cyan, fill=cyan!50, minimum height=1cm, minimum width=3cm, rounded corners, right= 1mm of 6] (7) {$\lm{x}{\infty}\dfrac{f(x)}{x} = 0$};
\node[rectangle, draw=cyan, fill=cyan!50, minimum height=1cm, minimum width=3cm, rounded corners, below left= 1cm and -2cm of 5] (8) {$\lm{x}{\infty}\left[f(x) - ax\right] = b$};
\node[rectangle, draw=cyan, fill=cyan!50, minimum height=1cm, minimum width=3cm, rounded corners, right= 1mm of 8] (9) {$\lm{x}{\infty}\left[f(x) - ax\right] = \infty$};
\node[rectangle, draw=green, fill=green!50, minimum height=5cm, rounded corners, below left = 1cm and 2cm of 8] (10) {
\begin{minipage}{2.5cm}
$(C_f)$ admet une \\ asymptote horizontale \\ d'équation $y=a$ \\ au voisinage de $\infty$
\end{minipage}};
\node[rectangle, draw=green, fill=green!50, minimum height=5cm, rounded corners, right = 1mm of 10] (11) {
\begin{minipage}{2.5cm}
$(C_f)$ admet une \\ asymptote oblique \\ d'équation $y=ax+b$ \\ au voisinage de $\infty$
\end{minipage}};
\node[rectangle, draw=green, fill=green!50, minimum height=5cm, rounded corners, right = 1mm of 11] (12) {
\begin{minipage}{2.5cm}
$(C_f)$ admet une \\ branche parabolique \\ de direction la droite \\ d'équation $y=ax$ \\ au voisinage de $\infty$
\end{minipage}};
\node[rectangle, draw=green, fill=green!50, minimum height=5cm, rounded corners, right = 1mm of 12] (13) {
\begin{minipage}{2.5cm}
$(C_f)$ admet une \\ branche parabolique \\ de direction l'axe des ordonnées \\ d'équation $y=ax$ \\ au voisinage de $\infty$
\end{minipage}};
\node[rectangle, draw=green, fill=green!50, minimum height=5cm, rounded corners, right = 1mm of 13] (14) {
\begin{minipage}{2.5cm}
$(C_f)$ admet une \\ branche parabolique \\ de direction l'axe des abscisses \\ d'équation $y=ax$ \\ au voisinage de $\infty$
\end{minipage}};
\node[rectangle, draw=green, fill=green!50, minimum height=5cm, rounded corners, right = 1mm of 14] (15) {
\begin{minipage}{2.5cm}
$(C_f)$ admet une \\ asymptote verticale \\ d'équation $x=a$
\end{minipage}};
\draw[blue, very thick,-latex] ([xshift=-2cm]1.south) -- ([xshift=-1cm] 10.north);
\draw[blue, very thick,-latex] ([xshift=2cm]3.south) -- ([xshift=1cm] 15.north);
\draw[blue, very thick,-latex] ([xshift=-1mm]2.south) -- (4.north);
\draw[blue, very thick,-latex] (2.south) -- (5.north);
\draw[blue, very thick,-latex] ([xshift=1mm]2.south) -- (6.north);
\draw[blue, very thick,-latex] ([xshift=3mm]2.south) -- (7.north);
\draw[blue, very thick,-latex] (5.south) -- (8.north);
\draw[blue, very thick,-latex] (5.south) -- (9.north);
\draw[blue, very thick,-latex] (4.south) -- (11.north);
\draw[blue, very thick,-latex] (8.south) -- (11.north);
\draw[blue, very thick,-latex] (9.south) -- (12.north);
\draw[blue, very thick,-latex] (6.south) -- (13.north);
\draw[blue, very thick,-latex] (7.south) -- (14.north);
\end{tikzpicture}
\end{center}
\end{document}
Respuesta1
Esta es una manera de hacerlo, reutilizando su enfoque tanto como sea posible. Sin embargo, para la colocación existen alternativas mejores y más consistentes. Al menos es un mejor punto de partida.
Por favor siga el flow of changes
de mi comentario:
% ~~~ REFACTORING ~~~~~~~~~~~~
% * commented out unsused packages
% * defining styles to simplify code (you can still remove or vary all those \\)
% * adjusted code indenting and formatting for better visibility of what's going on
% * tried \def vs. \newcommand, which seems to be a bit faster during compile
% (Tikz seems to prefer TeX-notation here)
% * demonstrated refactoring for the connectors: (2) -- (4), (5) -- (8)
The styles
relacionados con colores, tamaños, etc. podrían refactorizarse aún más, pero son lo suficientemente buenos por ahora. Lo mismo ocurre con los turnos.
Please look up
todos esos detalles en paralelo en elpgfmanual.
For the brown row
Adopté su enfoque, simplificando el cambio, es decir, reemplazando su derecho de opción (que causó un error como se indicó).
For the other ones
el enfoque es diferente:
- coloque el primero (más a la izquierda)
\node
en una posición absoluta - colóquelos de este a oeste con algún desplazamiento x en el medio, definido en
XSBL
etc.
The text in the green boxes
se puede controlar mejor en Tikz a través de text width=
y align=
, verpgfmanual. En mi enfoque ya no son \\
necesarios, pero aún puedes usarlos para controlar mejor el flujo de texto.
The changes for the connectors
Demostré las líneas (2) -- (4)
y (5) -- (8)
, dejándole ajustes detallados:
- el primero es sencillo,
- el segundo requiere un punto intermedio, dado en coordenadas relativas
- ! ¡El desplazamiento hacia abajo Y el radio de la esquina pueden provocar artefactos!
The key syntax here
está usando la coordenada polar <node name>.<angle>
. Por ejemplo, (2.185)
toma el nodo (2), irradia un haz desde el centro y ángulo de este nodo 185deg
(o un poco más lejos que el oeste en términos náuticos), hasta que se cruza con el límite del nodo. De esta manera puedes mover los puntos de inicio y fin de la forma que desees.
Lots is left for you
en términos de ajustes, básicamente:
- los cambios en
XSB
,XSBL
yXSG
- los ángulos polares para cada nodo
- tal vez las posiciones absolutas de los nodos izquierdos
Putting an arrow midway
es posible, pero requiere algo de decoración, lo que aumenta el tiempo de compilación la mayor parte del tiempo. ¿Realmente lo necesitas?
Finally
Siempre es una buena idea realizar una codificación limpia desde el principio y refactorizar tan a menudo como sea posible.
% ~~~ REFACTORING ~~~~~~~~~~~~
% * commented out unsused packages
% * defining styles to simplify code (you can still remove or vary all those \\)
% * adjusted code indenting and formatting for better visibility of what's going on
% * tried \def vs. \newcommand, which seems to be a bit faster during compile
% (Tikz seems to prefer TeX-notation here)
% * demonstrated refactoring for the connectors: (2) -- (4), (5) -- (8)
\documentclass[]{article}
\usepackage[left=.5cm,right=.5cm,top=3cm,bottom=1cm]{geometry}
\usepackage{tikz}
\usetikzlibrary{arrows.meta} % <<<
%\usepackage{tkz-euclide}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
%\usepackage{esvect}
%\usepackage{ifthen}
%\usepackage{stmaryrd}
%\usepackage{xspace}
%\usepackage{mathtools}
%\newcommand{\lm}[2]{\displaystyle{\lim_{{#1}\to {#2}}}}
\def\lm#1#2{\displaystyle{\lim_{{#1}\to {#2}}}}
\begin{document}
\begin{center}
\begin{tikzpicture}[
DIM/.style={ minimum height=1cm, minimum width=5cm, rounded corners},
A/.style={draw=brown, fill=brown!75,DIM},
B/.style={draw=cyan, fill=cyan!50, DIM,minimum width=3cm},
C/.style={draw=green, fill=green!50, minimum height=5cm,
rounded corners,align=center,text width=25mm},
XSB/.style ={xshift=73mm},
XSBL/.style={anchor=west,xshift=2mm},
XSG/.style ={anchor=west,xshift=4mm},
ARR/.style ={blue, very thick,->,rounded corners=16pt},
> = {Stealth},
]
% ~~~ brown row ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\node[A,anchor=west] (1) at (0,0) {$\lm{x}{\infty}f(x) = a$};
\node[A] (2) at ([XSB] 1) {$\lm{x}{\infty}f(x) = \infty$};
\node[A] (3) at ([XSB] 2) {$\lm{x}{a}f(x) = a$};
% ~~~ 1st blue row ~~~~~~~~~~~~~~~~~~~~~~~~~
\node[B,anchor=west] (4) at (2,-3) {$\lm{x}{\infty}\left[f(x) - (ax - b)\right] = 0$};
\node[B,XSBL] (5) at (4.east) {$\lm{x}{\infty}\dfrac{f(x)}{x} = a \ ; \ a \neq 0$};
\node[B,XSBL] (6) at (5.east) {$\lm{x}{\infty}\dfrac{f(x)}{x} = \infty$};
\node[B,XSBL] (7) at (6.east) {$\lm{x}{\infty}\dfrac{f(x)}{x} = 0$};
% ~~~ 2nd blue row ~~~~~~~~~~~~~
\node[B,anchor=west] (8) at (4,-6) {$\lm{x}{\infty}\left[f(x) - ax\right] = b$};
\node[B,XSBL] (9) at (8.east) {$\lm{x}{\infty}\left[f(x) - ax\right] = \infty$};
% ~~~ green row ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\node[C,anchor=west] (10) at (0,-12){
$(C_f)$ admet une asymptote horizontale
d'équation $y=a$ \\ au voisinage de $\infty$};
\node[C,XSG] (11) at (10.east) {
$(C_f)$ admet une \\ asymptote oblique \\
d'équation $y=ax+b$ \\ au voisinage de $\infty$};
\node[C,XSG] (12) at (11.east) {
$(C_f)$ admet une \\ branche parabolique \\
de direction la droite \\ d'équation $y=ax$ \\
au voisinage de $\infty$};
\node[C,XSG] (13) at (12.east) {
$(C_f)$ admet une \\ branche parabolique \\
de direction l'axe des ordonnées \\ d'équation
$y=ax$ \\ au voisinage de $\infty$};
\node[C,XSG] (14) at (13.east) {
$(C_f)$ admet une \\ branche parabolique \\
de direction l'axe des abscisses \\
d'équation $y=ax$ \\ au voisinage de $\infty$};
\node[C,XSG] (15) at (14.east) {
$(C_f)$ admet une \\ asymptote verticale
\\ d'équation $x=a$};
% % ~~~ connectors ~~~~~~~~~~~~~~~~
\draw[ARR] ([xshift=-2cm]1.south) -- ([xshift=-1cm] 10.north);
\draw[ARR] ([xshift=2cm]3.south) -- ([xshift=1cm] 15.north);
% ~~~ TO DO: rework all other \draw's like this one: ~~~~~~~~~
\draw[ARR] (2.185) -| (4.20);
\draw[blue, very thick,-latex] (2.south) -- (5.north);
% \draw[blue, very thick,-latex] ([xshift=1mm]2.south) -- (6.north);
% \draw[blue, very thick,-latex] ([xshift=3mm]2.south) -- (7.north);
\draw[ARR] (5.230) -- ++(0,-.6) -| (8.north);
% \draw[blue, very thick,-latex] (5.south) -- (9.north);
% \draw[blue, very thick,-latex] (4.south) -- (11.north);
% \draw[blue, very thick,-latex] (8.south) -- (11.north);
% \draw[blue, very thick,-latex] (9.south) -- (12.north);
% \draw[blue, very thick,-latex] (6.south) -- (13.north);
% \draw[blue, very thick,-latex] (7.south) -- (14.north);
\end{tikzpicture}
\end{center}
\end{document}