0

enter image description here

i simply want to create something like this, i tried something like this:

\documentclass{beamer}

%layout
\mode<presentation>{
\usetheme{Madrid}
}
\usepackage{tikz}
\usepackage{pgfplots}

\begin{document}
\begin{frame}
\frametitle{Diagramm}
\begin{tikzpicture}
\begin{axis}[xmax=6,ymax=1]
\addplot [fill=red] coordinates
{(0,1) (2,1)}
\closedcycle;
\addplot [fill=green] coordinates
{(3,1) (6,1)}
\closedcycle;
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}
3
  • Please understand that your code should be complete enough, starting with \documentclass, so we can copy&run it. The way it is everybody has to compensate posters lazyness, which may be a bad motivator for answers.
    – MS-SPO
    Jun 14 at 12:56
  • @MS-SPO thank you for your answer, i edited the original post. Jun 14 at 13:02
  • 1
    I would suggest to draw it in tikz alone, and the first tutorial section in pgfmanual (html) introduces all commands and syntaxes you need. Jun 14 at 13:36

1 Answer 1

2

Try this code:

\documentclass{beamer}

%layout
\mode<presentation>{
\usetheme{Madrid}
}
\usepackage{tikz}
\usepackage{pgfplots}

\begin{document}
\begin{frame}
\frametitle{Diagramm}
\begin{tikzpicture}[scale=2]
\filldraw[green] (1,0) rectangle (2,1);
\node[text width=2cm] at (1.5,0.5) () {\bfseries \footnotesize Damit\\ beschatungen mir aus};
\filldraw[red] (3,0) rectangle (5.5,1); 
\node at (4.25,0.5) () {\bfseries NP};
\draw[line width=3,-latex] (1,0)--(5.5,0);
\foreach \x in {1,...,5}
    \draw (\x,0.1)--(\x,-.1) node[below] {\x};
\node at (3,-.5) () {\bfseries \footnotesize Maximale Anzahl von Literalen in jeder Klausel}

\end{tikzpicture}
\end{frame}
\end{document}

Output:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.