I am quite new to Latex and I like to do a graphic on my own with TikZ.
The graphics should look more or lesse the same as this:
https://www.energie-lexikon.info/img/ph ... erung1.png
I am currently almost done, but what I miss is the axis lettering which I have no clue to realize. I read through different documentations but nothing works that well.
Can you help me with it?
Second, I like to know if my code is good for what I like to do. Or can I improve it or do it better in less code?
Code: Select all
\documentclass[parskip=full]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[autostyle=true,german=quotes]{csquotes}
\usepackage[ngerman]{babel}
\usepackage{lmodern}
\usepackage{booktabs}
\usepackage{marvosym}
\usepackage{float}
\usepackage{caption}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{gensymb}
\usepackage{todonotes}
\usepackage{amsmath, amsfonts, amssymb}
\usepackage[per-mode=fraction, decimalsymbol=comma]{siunitx}
\usepackage{babelbib}
\usepackage{textcomp}
\usepackage[hidelinks]{hyperref}
\begin{document}
\begin{tikzpicture}[domain=0:14]
\draw[step=1, gray, very thin, loosely dotted] (0,-2.5) grid (14,2.5);
\draw[->, thick] (-0.2,0) -- (14.3,0) node[right] {$t$};
\draw[->, thick] (0,-2.6) -- (0,2.6) node[above] {$V(t)$};
\draw [color=black, samples=300, dashed] plot (\x, {2*sin(\x r});
\begin{scope}[color=red, samples=10, very thick]
\draw [domain=2.3:3.1415] plot (\x, {2*sin(\x r});
\draw [domain=5.441:6.2841] plot (\x, {2*sin(\x r});
\draw [domain=8.583:9.4247] plot (\x, {2*sin(\x r});
\draw [domain=11.7247:12.566] plot (\x, {2*sin(\x r});
\end{scope}
\begin{scope}[color=red, very thick]
\draw (0,0)--(2.3,0);
\draw (2.3,0)--(2.3,1.4914);
\draw (5.441,0)--(5.441,-1.4914);
\draw (3.1415,0)--(5.441,0);
\draw (8.583,0)--(8.583,1.4914);
\draw (6.2841,0)--(8.583,0);
\draw (11.7247,0)--(11.7247,-1.4914);
\draw (9.4247,0)--(11.7247,0);
\draw (12.566,0)--(14,0);
\end{scope}
\end{tikzpicture}
\end{document}