2

Is it possible to adjust the angle more than I did: [ABOVE RIGHT]

\draw [black, thick] (0.7,0) arc [start angle=0, end angle=110, radius=0.7cm]
        node [above right] {$\theta=\phi-\ang{90}$};

I'd like to remove it from the y axis and put it in more right than it is.

And How can I make a subtitle under this figure?

Voltage and current phasor of a capacitor.

enter image description here

    \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}
  • 2
    Please complete your code with \documentclass, the relevant packages and \begin{document}... \end{document}. Beyond that, could you please explain what you mean? Which angle? More right with respect to what? What have you adjusted it with respect to? I am not sure what you mean by 'subtitle'. Documents sometimes have subtitles. Do you just want a caption? If so, use \begin{figure}\centering\begin{tikzpicture}...\end{tikzpicture}\caption{My caption}\end{figure}, for example. – cfr Nov 05 '14 at 22:36

1 Answers1

5

The initial point of the angle needs to be located along the line, so using polar coordinates (20:0.7) is the easiest way to specify that:

enter image description here

To add a caption you can use the caption package. Alternatively you can add a \node to place text below the axis.

Notes:

  • I added rotation to the blue node as that seemed the easiest way to display the text.
  • If you don't want the Figure 1 use \captionof*

If you don't like the rotation, you can apply an xshift to shift the label over. So, with

node [midway, above right, xshift=-1.0em] {$\theta=\phi-\ang{90}$}

you obtain:

enter image description here


Code:

\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}

Peter Grill
  • 223,288
  • First of all, thanks a lot, Peter. I have another question now that is if it is possible to remove the name Figure 1 from the caption? – Francisco Maerle Nov 05 '14 at 22:57
  • @FranciscoMaerle: Have updated solution to eliminate the Figure:` and also to show how you can shift the node text. – Peter Grill Nov 06 '14 at 00:22