Ein Diagramm und eine Diagrammlinie zeichnen?

Ein Diagramm und eine Diagrammlinie zeichnen?

Wie kann ich diese Kurve in Latex {revtex4-1} darstellen?

\begin{center}
\begin{tikzpicture}
\begin{axis}[bar width=18pt,
 xtick=data,ymin=0,ymax=45,x tick label style=
{rotate=90,anchor=east}]
\addplot[ybar] coordinates{ (126.5  ,2 ) (134.5 ,4 ) (142.5 ,13) (150.5 ,20) (158.5 ,35) (166.5 ,33) (174.5 ,25) (182.5 ,17) (190.5 ,5 ) (198.5 ,3 )  };
\addplot +[smooth,black,mark = *,mark options={solid,black}]coordinates{ (126.5,    1.3 ) (134.5,   4.3 ) (142.5,   11.2) (150.5,   22.6) (158.5,   31.2) (166.5,   33.5) (174.5,   26.9) (182.5,   16.2) (190.5,   7.2 ) (198.5,   2.4 )};

Bildbeschreibung hier eingeben

Antwort1

Um das gewünschte Format zu erhalten, können Sie Folgendes anwenden:

  • draw=red, pattern=north west lines, pattern color=redum das Muster für die Füllung der Balken bereitzustellen
  • marks=nonedie Punkte zu beseitigen
  • /pgf/number format/fixedund /pgf/number format/precision=0zur Steuerung der Anzeige der x ticks labelsund
  • ylabel={Count} andxlabel={Time}` zum Beschriften der Achse

Bildbeschreibung hier eingeben

Code:

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\usetikzlibrary{patterns}


\begin{document}
\noindent
\begin{tikzpicture}
\begin{axis}[bar width=18pt,
     xtick=data,ymin=0,ymax=45,
     x tick label style={
         rotate=90,
         anchor=east,
         /pgf/number format/fixed,
         /pgf/number format/precision=0,
         },
         ylabel={Count},
         xlabel={Time},
 ]
\addplot[ybar, draw=red, thick, pattern=north west lines, pattern color=red] coordinates{ (126.5  ,2 ) (134.5 ,4 ) (142.5 ,13) (150.5 ,20) (158.5 ,35) (166.5 ,33) (174.5 ,25) (182.5 ,17) (190.5 ,5 ) (198.5 ,3 )  };
\addplot +[smooth,black,mark=none, thick] coordinates{ (126.5,    1.3 ) (134.5,   4.3 ) (142.5,   11.2) (150.5,   22.6) (158.5,   31.2) (166.5,   33.5) (174.5,   26.9) (182.5,   16.2) (190.5,   7.2 ) (198.5,   2.4 )};
\end{axis}
\end{tikzpicture}

\end{document}

verwandte Informationen