
오늘 내 문제는 Tikz 축에 전기 회로(주로 \draw를 사용하여 그린)를 맞추는 것입니다.
나는 Axis 명령을 사용하여 일련의 점에서 곡선을 플롯(\addplot 사용)하고 있지만(지금까지는 문제가 없음) Tikzpicture가 앵커와 그 모든 것에 대해 어떻게 작동하는지 알 수 없습니다. 하지만 그 자리에 그대로 있어라.
더 명확하게 설명하기 위해 3개의 축을 만드는 코드는 다음과 같습니다(원하는 경우 하위 그림 3개, 상단에 2개, 왼쪽 하단에 1개).
\begin{tikzpicture}[scale=1]
% Vs(ve) graphique
\begin{axis}[name=plot1
]
\addplot[black] table {Fig_ELA2/ELA2_P3_C3/ELA2_P3_C1_PP_CLASSE_B/courbes/vs_ve_out.txt};
\end{axis}
% Vs(wt) graphique
\begin{axis}[name=plot2,at={($(plot1.east)+(1.5cm,0)$)},anchor=west
]
\addplot[black] table {Fig_ELA2/ELA2_P3_C3/ELA2_P3_C1_PP_CLASSE_B/courbes/vs_t_out.txt};
\end{axis}
% Ve(wt) graphique
\begin{axis}[name=plot3,at={($(plot1.south)-(0,1.5cm)$)},anchor=north
]
\addplot[black] table {Fig_ELA2/ELA2_P3_C3/ELA2_P3_C1_PP_CLASSE_B/courbes/ve_t_out.txt};
\end{axis}
% Electrical circuit
\draw
(0,0) node[njfet](J){$J$}
(J.S) to[short,-o] ++(0,-0.1) node[left](S){\tiny S} to [R, l_=$R_S$,-*] (0,-3) node(gnd_rs)[ground]{}
(J.D) to[short,-o] ++(0,0.3) node[left](D){\tiny D} to [R, l=$R_D$] ++(0,2) node[vcc]{\color{green} $V_{CC}$}
(J.G) to[short,-o] ++(-0.1,0) node[above](G){\tiny G}-- ++(-1,0) node(RG){}
;
\coordinate (gnd_rg) at (RG|-gnd_rs);
\draw (RG) to [R, l_=$R_G$,-*] (gnd_rg);
\draw (gnd_rs) to[short,-o] ++(-4,0) node(gnd_ve){};
\draw (gnd_rs) to[short,-*] ++(1,0) node(gnd_cs){} to[short,-o] ++(2,0) node(gnd_vs){};
\coordinate (ve) at (gnd_ve|-J.G);
\draw (ve) to[C,l=$C_{Le}$,o-*] (RG);
\coordinate (vs) at (gnd_vs|-D);
\draw (D) to[C,l=$C_{Ls}$,-o] (vs);
\coordinate (cs) at (S-|gnd_cs);
\draw (S) -- (cs) to[C,l=$C_S$,] (gnd_cs);
\draw[-triangle 45, red] (gnd_vs) -- (vs) node[right,pos=0.5]{$v_s(t)$};
\draw[-triangle 45, red] (gnd_ve) -- (ve) node[left,pos=0.5]{$v_e(t)$};
\end{tikzpicture}
테스트할 곡선을 제공하지 않아서 죄송합니다. 제 생각에는 멍청한 곡선을 만들 수도 있습니다(또는 전혀 추가 플롯을 만들지 않을 수도 있습니다).
따라서 전기 회로를 절대값으로 설정하고 CSS에서 절대값처럼 동작하도록 하는 방법이 있습니까(따라서 흐름에서 제외).
도움을 주셔서 감사합니다!
답변1
도움을 원하는 사람들이 당신의 서문이나 정의를 추측하지 않고도 도움을 줄 수 있도록 항상 독립적인 예제를 게시하려고 노력해야 합니다. 그럼에도 불구하고 이는 옵션입니다. --- 다음 사항에 유의하세요.
- 귀하의 회로에는 첫 번째 줄에 단 하나의 절대 좌표가 있으며
(0,-3)
이를 수정했습니다(그리고 귀하의 회로를 변환할 수 없게 만들었습니다). - 그래도 회로가 꽤 크기 때문에
scope
환경에 맞게 확장했습니다.
그래서 이런 일을 할 수 있습니다. ( ++(6,-5)
손으로 조정하는 것; 더 자동적인 일을 하는 것도 가능하지만 그것은 또 다른 이야기이며 다른 날에 이야기할 것입니다...)
\documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\usepackage{pgfplots}\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}[scale=1]
% Vs(ve) graphique
\begin{axis}[name=plot1
]
\addplot[black] {sin(x)};
\end{axis}
% Vs(wt) graphique
\begin{axis}[name=plot2,at={($(plot1.east)+(1.5cm,0)$)},anchor=west
]
\addplot[black] {cos(x)};
\end{axis}
% Ve(wt) graphique
\begin{axis}[name=plot3,at={($(plot1.south)-(0,1.5cm)$)},anchor=north
]
\addplot[black] {x};
\end{axis}
% Electrical circuit
\begin{scope}[scale=0.8, transform shape]
\draw
(plot1.south east) ++(6,-5) node[njfet](J){$J$}
(J.S) to[short,-o] ++(0,-0.1) node[left](S){\tiny S} to [R, l_=$R_S$,-*] ++(0,-3) node(gnd_rs)[ground]{}
(J.D) to[short,-o] ++(0,0.3) node[left](D){\tiny D} to [R, l=$R_D$] ++(0,2) node[vcc]{\color{green} $V_{CC}$}
(J.G) to[short,-o] ++(-0.1,0) node[above](G){\tiny G}-- ++(-1,0) node(RG){}
;
\coordinate (gnd_rg) at (RG|-gnd_rs);
\draw (RG) to [R, l_=$R_G$,-*] (gnd_rg);
\draw (gnd_rs) to[short,-o] ++(-4,0) node(gnd_ve){};
\draw (gnd_rs) to[short,-*] ++(1,0) node(gnd_cs){} to[short,-o] ++(2,0) node(gnd_vs){};
\coordinate (ve) at (gnd_ve|-J.G);
\draw (ve) to[C,l=$C_{Le}$,o-*] (RG);
\coordinate (vs) at (gnd_vs|-D);
\draw (D) to[C,l=$C_{Ls}$,-o] (vs);
\coordinate (cs) at (S-|gnd_cs);
\draw (S) -- (cs) to[C,l=$C_S$,] (gnd_cs);
\draw[->, red] (gnd_vs) -- (vs) node[right,pos=0.5]{$v_s(t)$};
\draw[->, red] (gnd_ve) -- (ve) node[left,pos=0.5]{$v_e(t)$};
\end{scope}
\end{tikzpicture}
\end{document}