2

Good evening,

I have now completed my six graphs. However there are still some issues I have not been able to resolve.

  1. As you can see, u_GR seems to be larger than u_2, which physically it can't be. Of course this will be clear once I add a label, however I'd like to make this appear that they are equally sized. I know this is due to the negative values in u_2.
  2. Concerning the labels, what would be "best" (that means best looking) way to accomplish the labels? If it were me, I would have defined a bunch of nodes (e.g at (0,1) for u_GR and labeled it U_something. Is there an automated way to accomplish that?
  3. Any suggestions what I should to to enhance the graph?

Thanks a lot.

% Basierend auf einer Vorlage von: Author: Urs Zellweger ([email protected]),s. http://texample.net/tikz/examples/phasor-diagram/
% Mit Hilfe von tex.stackexchange.com https://tex.stackexchange.com/questions/398784/coordinate-system-all-set-up-how-to-fill-it-now

\documentclass[11pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\usetikzlibrary{decorations, arrows}
\usepackage{amsmath}

\pgfplotsset{Diagram/.style={
   xmax=9,
  %xmin=0,
   ymax=1.5,
  %ymin=0,
   xlabel = {$t$},
   axis lines = middle, % may want to play around with if y-axis behavious weird
   xlabel style={at={(1,0)}, anchor=west},
   ylabel style={at={(0,1)}, anchor=north east}, %position y-Label left of y-axis
    ytick=\empty,
    no marks,
    every axis plot post/.append style={very thick, red},
                    }% end of Diagram style
            }% end of pgfplotsset


\begin{document}
%%%%%%%%%%%% Diagramme f. 4TPPC %%%%%%%%%%%%
\begin{figure}

\pgfplotsset{xticklabels={ , , , $T/2$, , $T$}, height=4cm, width=0.8\textwidth}

\centering

\begin{tikzpicture}[trim axis left]

\begin{axis}[Diagram, 
ylabel = $u_{GS_{1,4}}$, 
extra x ticks={3,7}, 
extra x tick labels={\mbox{\tiny $DT$},
\mbox{\tiny ${T/2+DT}$}}]

\addplot coordinates {(0,1)  (3,1) (3,0)  (8,0) };
\end{axis}

\end{tikzpicture}

\begin{tikzpicture}[trim axis left]

\begin{axis}[Diagram, ylabel = $U_{GS_{2,3}}$, extra x ticks={3,7}, extra x tick labels={\mbox{\tiny $DT$},\mbox{\tiny ${T/2+DT}$}}]
\addplot coordinates {(0,0)  (4,0)  (4,1)  (7,1) (7,0) (8,0)};
\end{axis}

\end{tikzpicture}

\begin{tikzpicture}[trim axis left]

\begin{axis}[Diagram, 
ylabel = $u_L$,
ymin=-1.5,
extra x ticks={3,7},
extra x tick labels={\mbox{\tiny $DT$},
\mbox{\tiny ${T/2+DT}$}},
ymin=-2, ymax=2]
\addplot coordinates {(0,.5)  (3,.5) (3,-1.5) (4,-1.5) (4,.5) (7,.5) (7,-1.5) (8,-1.5) (8,0) };



\end{axis}

\end{tikzpicture}

\begin{tikzpicture}[trim axis left]

\begin{axis}[Diagram, 
ylabel = $i_L$,
ymin=0,
extra x ticks={3,7},
extra x tick labels={\mbox{\tiny $DT$},
\mbox{\tiny ${T/2+DT}$}}]

\addplot coordinates {(0,.4)  (3,.7)  (4,.4)  (7,.7) (8,.4) };
\draw [ultra thin, blue, dashed] (0,0.7)  --  (8,0.7) ;
\draw [ultra thin, blue, dashed] (0,.4) -- (8,0.4) ;
\draw [thick, blue, <->] (8,.4) -- (8,.7);
\draw [thick, color=red ] (0,.55) -- (8,.55);
\node [right] at (8,.55){$\Delta i_L$};


\end{axis}

\end{tikzpicture}

\begin{tikzpicture}[trim axis left]

\begin{axis}[Diagram, 
ylabel = $u_2$,
extra x ticks={3,7},
extra x tick labels={\mbox{\tiny $DT$},
\mbox{\tiny ${T/2+DT}$}}]

\addplot coordinates {(0,1) (3,1) (3,0) (4,0) (4,-1) (7,-1) (7,0) (8,0)} ;

\end{axis}

\end{tikzpicture}

\begin{tikzpicture}[trim axis left]

\begin{axis}[Diagram, 
ylabel = $u_{GR}$,
extra x ticks={3,7},
extra x tick labels={\mbox{\tiny $DT$},
\mbox{\tiny ${T/2+DT}$}}]

\addplot coordinates {(0,1) (3,1) (3,0) (4,0) (4,1) (7,1) (7,0) (8,0)} ;

\end{axis}

\end{tikzpicture}


\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}
0

1 Answer 1

1

appearance like this?

enter image description here

regarding your subquestions:

  1. in all y labels are used the same font size, but labels appearing can be visual different due to used letters, for example u and U has (as had be) different height :-)
  2. appearing of labels can be better if you add \usepackage[low-sup]{subdepth} in document preamble (it push variable indexes lower, see image above and compare i result if you remove this package)
  3. i wold consider suggestion for xtick style given in my answer on one of your previous question

in code below are with % <--- indicated changes to yours. also are added few comments, so the code should be self explanatory:

\documentclass[11pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\usetikzlibrary{decorations, arrows}

\usepackage{amsmath}
\usepackage[low-sup]{subdepth}              % <--- added

\pgfplotsset{% global setings for pgfplots images
    Diagram/.style={axis lines = middle,
                    xmax=9,
                    ymax=1.5,
    ymin=0,
    xlabel = {$t$},
    xlabel style={anchor=west},             % <--- changed
    xticklabel style={font=\scriptsize},    % <--- added
    ylabel style={at={(0,1)}, anchor=north east}, % position y-label left of y-axis
    ytick=\empty,
    no marks,
    every axis plot post/.append style={very thick, red},
    set layers={axis on top}               % <--- added, maybe you liked
                    }% end of Diagram style
            }% end of pgfplotsset

\begin{document}
%%%%%%%%%%%% Diagramme f. 4TPPC %%%%%%%%%%%%
\begin{figure}

\pgfplotsset{% local settings, valid only in this figure environment
    height=4cm, width=0.8\textwidth,
    xticklabels={ , , , $T/2$, , $T$},      % <--- mowed here
    extra x ticks={3,7},                    % <--- mowed here
    extra x tick labels={$DT$, ${T/2+DT}$}  % <--- mowed here
            }% end of local pgfplotsset

\centering

    \begin{tikzpicture}[trim axis left]
\begin{axis}[Diagram,   ylabel = $u_{GS_{1,4}}$,]
\addplot coordinates {(0,1) (3,1) (3,0)  (8,0) };
\end{axis}
    \end{tikzpicture}

\smallskip
    \begin{tikzpicture}[trim axis left]
\begin{axis}[Diagram,   ylabel = $U_{GS_{2,3}}$]
\addplot coordinates {(0,0) (4,0)  (4,1)  (7,1) (7,0) (8,0)};
\end{axis}
    \end{tikzpicture}

\smallskip
    \begin{tikzpicture}[trim axis left]
\begin{axis}[Diagram,
            ylabel = $u_L$,
            ymin=-1.5]
\addplot coordinates {(0,.5) (3,.5) (3,-1.5) (4,-1.5)
                      (4,.5) (7,.5) (7,-1.5) (8,-1.5)
                      (8,0) };
\end{axis}
    \end{tikzpicture}

\smallskip
    \begin{tikzpicture}[trim axis left]
\begin{axis}[Diagram,
    ylabel = $i_L$,
            ]
\addplot coordinates {(0,.4)  (3,.7)  (4,.4)  (7,.7) (8,.4) };
    \draw [ultra thin, blue, dashed] (0,0.7) -- (8,0.7) ;
    \draw [ultra thin, blue, dashed] (0,0.4) -- (8,0.4) ;
    \draw [thick, blue, <->] (8,.4) -- (8,.7);
    \draw [thick, color=red ] (0,.55) -- (8,.55);
    \node [right] at (8,.55){$\Delta i_L$};
\end{axis}
    \end{tikzpicture}

\smallskip
    \begin{tikzpicture}[trim axis left]
\begin{axis}[Diagram,   ylabel = $u_2$]
\addplot coordinates {(0,1) (3,1) (3,0) (4,0) (4,-1) (7,-1) (7,0) (8,0)} ;
\end{axis}
    \end{tikzpicture}

\smallskip
    \begin{tikzpicture}[trim axis left]
\begin{axis}[Diagram,   ylabel = $u_{GR}$]
\addplot coordinates {(0,1) (3,1) (3,0) (4,0) (4,1) (7,1) (7,0) (8,0)} ;
\end{axis}
    \end{tikzpicture}
\end{figure}
%%%%%%%%%%%% end of Diagramme f. 4TPPC %%%%%
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .