Example: Markers in a line diagram

Published 2014-03-15 | Author: Elke Schubert

Besides x and y values, special markers illustrate the result.

This topic was discussed on: http://texwelt.de/wissen/fragen/3363/

Download as: [PDF] [TEX]  •  [Open in Overleaf]

Markers in a line diagram

Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the LaTeX Forum.
Oder frag auf Deutsch auf TeXwelt.de.

\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=7cm, compat=1.8, grid style={dashed}}
\begin{document}
\begin{tikzpicture}
  \begin{axis}[
    scatter,
    scatter src = explicite,
    grid        = major, % draws coordinate grid
    xlabel      = Force $\lbrack{}$ F $\rbrack$, 
    ylabel      = Amperage $\lbrack{}$ kA $\rbrack$,
    width       = \linewidth,
    height      = 10cm,
    xmin = 0, xmax = 15,
    ymin = 0, ymax = 12,
    ]
    \addplot+ [
      visualization depends on =
        {10*\thisrow{result1} \as \perpointmarksize},
      scatter/@pre marker code/.append style =
        {/tikz/mark size = \perpointmarksize},
    ]
    table[x=measuring, y=power1, point meta=\thisrow{result1}] {data.csv};
    \addplot+ [
      visualization depends on =
        {10*\thisrow{result2} \as \perpointmarksize},
      scatter/@pre marker code/.append style =
        {/tikz/mark size = \perpointmarksize}
    ]
    table [x=measuring, y=power2, point meta=\thisrow{result2}] {data.csv};
    \fill [gray, fill opacity=0.25] (axis cs:5,0) rectangle (axis cs:7,12);
  \end{axis}
\end{tikzpicture}
\end{document}

Comments

Adding comments is currently not enabled.