1

I am trying to create a basic scatter plot where each point's mark size has a unique value given by a 3rd column in the dat file. In the code below, mark size should be mediated by the 'Mag' column. For example, if Mag = 0.13, then mark size = 0.13pt. I don't know how to map the 3rd column to mark size. Thanks!

\documentclass[tikz, border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{plotmarks}
\usepackage{amsmath}
\usepackage{filecontents}

\begin{filecontents}{temp.dat} RA DEC Mag 78.63 -8.20 0.13 88.79 7.41 0.42 81.28 6.35 1.64 84.05 -1.20 1.69 85.19 -1.94 1.77 86.94 -9.67 2.06 83.00 -0.30 2.41 83.86 -5.91 2.77 72.46 6.96 3.19 81.12 -2.40 3.35 83.78 9.93 3.47 79.40 -6.84 3.59 83.78 9.93 3.66 72.80 5.61 3.68 73.56 2.44 3.73 84.69 -2.60 3.79 74.09 13.51 4.06 84.23 9.29 4.09 80.99 -7.81 4.12 90.60 9.65 4.13 82.70 5.95 4.2 72.65 8.90 4.35 91.89 14.77 4.397 88.60 20.28 4.4 83.71 9.49 4.41 78.32 2.86 4.44 74.64 1.71 4.459 92.98 14.21 4.48 83.85 -4.84 4.59 84.80 4.12 4.59 \end{filecontents}

\begin{document} \pgfplotstableread{temp.dat}{\tempdat} \begin{tikzpicture}

\begin{axis} \addplot[% only marks, mark=*, ] table [x={RA},y={DEC}] {\tempdat}; \end{axis} \end{tikzpicture} \end{document}

  • Hi, welcome. See if https://tex.stackexchange.com/questions/157380/how-to-keep-the-same-mark-colour-when-using-meta-data-for-marker-size helps. – Torbjørn T. Jun 28 '22 at 18:15

0 Answers0