是否可以比我调整更多角度:[右上方]
\draw [black, thick] (0.7,0) arc [start angle=0, end angle=110, radius=0.7cm]
node [above right] {$\theta=\phi-\ang{90}$};
我想将它从 y 轴上移除,然后将其放置在比现在更靠右的位置。
我怎样才能在这个图下添加字幕?
电容器的电压和电流相量。
\usepackage{tikz}
\usepackage{siunitx}
\begin{document}
\begin{center}
\begin{tikzpicture}[>=latex]
\draw[style=help lines] (0,0) (3,2);
\coordinate (vec1) at (110:2);
\coordinate (vec2) at (20:4);
\coordinate (vec3) at (0:4.5);
\coordinate (vec4) at (90:2.5);
\coordinate (vec5) at (270:1.5);
\coordinate (vec6) at (180:3);
\draw[->,thick,black] (0,0) -- (vec1) node[below left] {$\hat{I}$};
\draw[->,thick,black] (0,0) -- (vec2) node[below right] {$\hat{V}$};
\draw[->,thick,black] (0,0) -- (vec3) node [below] {$Re$};
\draw[->,thick,black] (0,0) -- (vec4) node [right] {$Im$};
\draw[->,thick,black] (0,0) -- (vec5);
\draw[->,thick,black] (0,0) -- (vec6);
\draw [black, thick] (1.3,0) arc [start angle=0, end angle=20, radius=1.3cm]
node [midway, right] {$\phi$};
\draw [black, thick] (0.7,0) arc [start angle=0, end angle=110, radius=0.7cm]
node [above right] {$\theta=\phi-\ang{90}$};
\end{tikzpicture}
\end{center}
\end{document}
答案1
角度的初始点需要位于线上,因此使用极坐标(20:0.7)
是最简单的指定方法:
要添加标题,您可以使用caption
包。或者,您可以添加\node
将文本放置在轴下方。
笔记:
- 我为蓝色节点添加了旋转,因为这似乎是显示文本最简单的方法。
- 如果你不想
Figure 1
使用\captionof*
如果您不喜欢rotation
,可以应用xshift
将标签移开。因此,使用
node [midway, above right, xshift=-1.0em] {$\theta=\phi-\ang{90}$}
您将获得:
代码:
\documentclass{article}
\usepackage{tikz}
\usepackage{siunitx}
\usepackage{caption}
\begin{document}
{\centering
\begin{tikzpicture}[>=latex]
\draw[style=help lines] (0,0) (3,2);
\coordinate (vec1) at (110:2);
\coordinate (vec2) at (20:4);
\coordinate (vec3) at (0:4.5);
\coordinate (vec4) at (90:2.5);
\coordinate (vec5) at (270:1.5);
\coordinate (vec6) at (180:3);
\draw[->,thick,black] (0,0) -- (vec1) node[below left] {$\hat{I}$};
\draw[->,thick,black] (0,0) -- (vec2) node[below right] {$\hat{V}$};
\draw[->,thick,black] (0,0) -- (vec3) node [below] {$Re$};
\draw[->,thick,black] (0,0) -- (vec4) node [right] {$Im$};
\draw[->,thick,black] (0,0) -- (vec5);
\draw[->,thick,black] (0,0) -- (vec6);
\draw [red, thick] (1.3,0) arc [start angle=0, end angle=20, radius=1.3cm]
node [midway, right] {$\phi$};
\draw [blue, thick] (20:0.7) arc [start angle=20, end angle=110, radius=0.7cm]
node [midway, right, rotate=45] {$\theta=\phi-\ang{90}$};
\node [below, color=black] at (270:1.5) {Voltage and current phasor of a capacitor. (via node)};
\end{tikzpicture}%
\captionof*{figure}{Voltage and current phasor of a capacitor. (via captionof)}}
\end{document}