Example: Scatter Plot

Published 2014-03-15 | Author: Christian Feuersänger

We want to generate a scatter plot: assume that we are given a couple of special (x; y) coordinates along with color data at every vertex. We would like to draw markers at the positions and choose individual colors depending on the color data.

The code is from the PGFPlots 1.10 manual: “3.4 Use Cases involving Scatter Plots”.

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

Scatter Plot

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}
\usepackage{pgfplotstable}
\pgfplotsset{width=7cm,compat=1.8}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
	enlargelimits=false,
	colorbar,
]
\addplot+[
	only marks,
	scatter,
	point meta={ln(1e-6+abs(\thisrow{f(x)}))/ln(10)},
	mark size=0.6pt,
]
table
	{concat_VV_together_grid.dat};
\end{axis}
\end{tikzpicture}
\end{document}

Comments

Adding comments is currently not enabled.

There are currently 0 comments on this entry.

Features
Tags
Scientific and technical areas

Creative Commons License