csv-2d-point-plot.tex 1.1 KB

123456789101112131415161718192021222324252627282930
  1. \documentclass[varwidth=true, border=2pt]{standalone}
  2. \usepackage[utf8]{inputenc} % this is needed for umlauts
  3. \usepackage[ngerman]{babel} % this is needed for umlauts
  4. \usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
  5. \usepackage[margin=2.5cm]{geometry} %layout
  6. \usepackage{pgfplots}
  7. \begin{document}
  8. \begin{tikzpicture}
  9. \begin{axis}[
  10. width=15cm, height=8cm, % size of the image
  11. xlabel=mean,
  12. ylabel=variance,
  13. visualization depends on={value \thisrow{label} \as \label},
  14. % every node near coord/.append style={font={\tiny}},
  15. nodes near coords={\label},
  16. % nodes near coords align={horizontal}
  17. ]
  18. \addplot[scatter,
  19. mark=*,only marks,
  20. % nodes near coords*=\label,
  21. % ... which requires to define a visualization dependency:
  22. % visualization depends on={\thisrow{label} \as \label}
  23. ]
  24. table [x=mean, y=variance, col sep=comma] {data.csv};
  25. \end{axis}
  26. \end{tikzpicture}
  27. \end{document}